mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
增加smtp的帮助
This commit is contained in:
parent
d79b85d915
commit
3d8e457f23
@ -4,15 +4,17 @@ import os
|
|||||||
|
|
||||||
WEBSITE_INFO = {"website_name": u"example大学 OnlineJudge",
|
WEBSITE_INFO = {"website_name": u"example大学 OnlineJudge",
|
||||||
"website_name_shortcut": u"example oj",
|
"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结尾没有/
|
||||||
"url": u"http://your-domain-or-ip.com"}
|
"url": u"http://your-domain-or-ip.com"}
|
||||||
|
|
||||||
|
|
||||||
|
# https://github.com/QingdaoU/OnlineJudge/wiki/SMTP
|
||||||
SMTP_CONFIG = {"smtp_server": "smtp.domain.com",
|
SMTP_CONFIG = {"smtp_server": "smtp.domain.com",
|
||||||
"email": "noreply@domain.com",
|
"email": "noreply@domain.com",
|
||||||
"password": "your_password",
|
"password": "your_password",
|
||||||
"tls": False}
|
"port": 25,
|
||||||
|
"tls": True}
|
||||||
|
|
||||||
|
|
||||||
# 是否显示所有人的提交, False就只显示自己的
|
# 是否显示所有人的提交, False就只显示自己的
|
||||||
|
|||||||
@ -12,4 +12,5 @@ def send_email(from_name, to_email, to_name, subject, content):
|
|||||||
envelope.send(settings.SMTP_CONFIG["smtp_server"],
|
envelope.send(settings.SMTP_CONFIG["smtp_server"],
|
||||||
login=settings.SMTP_CONFIG["email"],
|
login=settings.SMTP_CONFIG["email"],
|
||||||
password=settings.SMTP_CONFIG["password"],
|
password=settings.SMTP_CONFIG["password"],
|
||||||
|
port=settings.SMTP_CONFIG["port"],
|
||||||
tls=settings.SMTP_CONFIG["tls"])
|
tls=settings.SMTP_CONFIG["tls"])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user