From 3d8e457f2314c723083001030f444b1688ca1168 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Mon, 26 Dec 2016 21:06:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0smtp=E7=9A=84=E5=B8=AE?= =?UTF-8?q?=E5=8A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oj/custom_settings.example.py | 6 ++++-- utils/mail.py | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/oj/custom_settings.example.py b/oj/custom_settings.example.py index 4607c0c9..9ca8427e 100644 --- a/oj/custom_settings.example.py +++ b/oj/custom_settings.example.py @@ -4,15 +4,17 @@ import os WEBSITE_INFO = {"website_name": u"example大学 OnlineJudge", "website_name_shortcut": u"example oj", - "website_footer": u"example大学foobar学院 京ICP备10086号-1", + "website_footer": u"example大学foobar学院 京ICP备233333号-1", # url结尾没有/ "url": u"http://your-domain-or-ip.com"} +# https://github.com/QingdaoU/OnlineJudge/wiki/SMTP SMTP_CONFIG = {"smtp_server": "smtp.domain.com", "email": "noreply@domain.com", "password": "your_password", - "tls": False} + "port": 25, + "tls": True} # 是否显示所有人的提交, False就只显示自己的 diff --git a/utils/mail.py b/utils/mail.py index 5d4e1c3c..e8756fa9 100644 --- a/utils/mail.py +++ b/utils/mail.py @@ -12,4 +12,5 @@ def send_email(from_name, to_email, to_name, subject, content): envelope.send(settings.SMTP_CONFIG["smtp_server"], login=settings.SMTP_CONFIG["email"], password=settings.SMTP_CONFIG["password"], + port=settings.SMTP_CONFIG["port"], tls=settings.SMTP_CONFIG["tls"])