try to fix: SMTP AUTH extension not supported by server.

pull/105/head
Apex Liu 2018-03-09 18:08:46 +08:00
parent 6d95dcabe2
commit dea9c48d82
1 changed files with 1 additions and 0 deletions

View File

@ -102,6 +102,7 @@ def tp_send_mail(recipient, message, subject=None, sender=None, cc=None, bcc=Non
if _ssl:
_smtp = smtplib.SMTP_SSL(_server, _port, timeout=10.0)
_smtp.ehlo()
_smtp.starttls() # Fix: smtp auth extension not supported by server
else:
_smtp = smtplib.SMTP(_server, _port, timeout=10.0)
_smtp.helo()