From cb8e0aada664caed279dcf525f366529511d4e55 Mon Sep 17 00:00:00 2001 From: bnpzsx <1150892585@qq.com> Date: Sat, 7 Sep 2019 18:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调用starttls()需要重新认证 --- py12306/helpers/notification.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py12306/helpers/notification.py b/py12306/helpers/notification.py index 6a1beb4..280372b 100644 --- a/py12306/helpers/notification.py +++ b/py12306/helpers/notification.py @@ -125,9 +125,9 @@ class Notification(): message.set_content(content) try: server = smtplib.SMTP(Config().EMAIL_SERVER_HOST) - server.login(Config().EMAIL_SERVER_USER, Config().EMAIL_SERVER_PASSWORD) server.ehlo() server.starttls() + server.login(Config().EMAIL_SERVER_USER, Config().EMAIL_SERVER_PASSWORD) server.send_message(message) server.quit() CommonLog.add_quick_log(CommonLog.MESSAGE_SEND_EMAIL_SUCCESS).flush()