修正:SMTP邮件发送与Exchange 2016兼容性问题(#82)

pull/105/head
Apex Liu 2018-09-11 04:04:44 +08:00
parent 2c487e9fc1
commit 0f3c8900dd
1 changed files with 5 additions and 0 deletions

View File

@ -113,6 +113,11 @@ def tp_send_mail(recipient, message, subject=None, sender=None, cc=None, bcc=Non
if dbg_mode:
_smtp.set_debuglevel(1)
_smtp.ehlo()
if _smtp.has_extn("starttls"):
try:
_smtp.starttls()
except:
pass
_smtp.login(_username, _password)