增加smtp的帮助

This commit is contained in:
virusdefender 2016-12-26 21:06:52 +08:00
parent d79b85d915
commit 3d8e457f23
2 changed files with 5 additions and 2 deletions

View File

@ -4,15 +4,17 @@ import os
WEBSITE_INFO = {"website_name": u"example大学 OnlineJudge",
"website_name_shortcut": u"example oj",
"website_footer": u"example大学foobar学院 <a href=\"http://www.miibeian.gov.cn/\">京ICP备10086号-1</a>",
"website_footer": u"example大学foobar学院 <a href=\"http://www.miibeian.gov.cn/\">京ICP备233333号-1</a>",
# 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就只显示自己的

View File

@ -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"])