zoukankan      html  css  js  c++  java
  • python exchanglib 发送html邮件

    def Email(to, content):
        urllib3.disable_warnings()
        creds = Credentials(
            username='algexspsaccount',
            password='Spsaccount'
        )
        config = Configuration(server="smtp.algex.asmpt.com", credentials=creds, auth_type=NTLM)
        account = Account(
            primary_smtp_address='Spsaccount@alg.asmpt.com',
            credentials=creds,
            autodiscover=False,
            config=config,
            access_type=DELEGATE
        )
    
    
    
        m = Message(
            account=account,
            subject="Guest pass key generated",
            body=HTMLBody(content),
            to_recipients = [Mailbox(email_address=to)],
            cc_recipients = [Mailbox(email_address=cc)],
        )
    
        m.send()
    

    上一篇文章:https://www.cnblogs.com/jpinsz/p/12418876.html 说到了使用smtplib来发邮件,但是用特定户口时提示535, b'5.7.3 Authentication unsuccessful'报错,一时无法解决

    于是找到另一种办法,是用于与exchange server一起使用的,完美解决了我的问题,这里大概记录下,日后有用,嘿嘿

  • 相关阅读:
    设计模式
    idea多个项目
    多个tomcat配置
    mysql数据库默认时间字段格式
    读取文件
    上传图片
    数据库创建用户授权
    统计12个月份的数据
    行列转换
    分页
  • 原文地址:https://www.cnblogs.com/jpinsz/p/12420991.html
Copyright © 2011-2022 走看看