python exchanglib 发送html邮件
Posted JPinsz
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python exchanglib 发送html邮件相关的知识,希望对你有一定的参考价值。
def Email(to, content): urllib3.disable_warnings() creds = Credentials( username=\'algex\\spsaccount\', 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一起使用的,完美解决了我的问题,这里大概记录下,日后有用,嘿嘿
以上是关于python exchanglib 发送html邮件的主要内容,如果未能解决你的问题,请参考以下文章