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一起使用的,完美解决了我的问题,这里大概记录下,日后有用,嘿嘿

  • 相关阅读:
    Jmeter属性和变量
    用trie树解决最大异或对问题(On)
    trie树
    kmp算法
    数学归纳法
    单调栈和单调队列
    区间合并
    离散化
    位运算
    双指针算法
  • 原文地址:https://www.cnblogs.com/jpinsz/p/12420991.html
Copyright © 2011-2022 走看看