1、添加邮箱的身份认证

2、修改发件人为配置文件的第一个
3、修改版本号
This commit is contained in:
halliday 2024-03-19 18:56:38 +08:00
parent 02e3d542b6
commit 49bb6eada3
3 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,9 @@
changes log changes log
====================================== ======================================
------------------------------
1.0.2 2024-03-19
增加发送邮件的身份认证
------------------------------ ------------------------------
1.0.1 2023-11-28 1.0.1 2023-11-28

View File

@ -42,7 +42,7 @@ need_sendmail = False
def send_mail(): def send_mail():
# 发件人 # 发件人
sender = 'mh@unamail.com' sender = config["receivers"][0]
# 接收邮件,可以发给多人 # 接收邮件,可以发给多人
receivers = config["receivers"] receivers = config["receivers"]
# 邮件主体 # 邮件主体
@ -72,6 +72,8 @@ def send_mail():
try: try:
smtpObj = smtplib.SMTP('10.10.110.102') smtpObj = smtplib.SMTP('10.10.110.102')
#身份认证
smtpObj.login(sender,"111111")
smtpObj.sendmail(sender, receivers, msg.as_string()) smtpObj.sendmail(sender, receivers, msg.as_string())
print("邮件发送成功") print("邮件发送成功")
except smtplib.SMTPException: except smtplib.SMTPException:

View File

@ -31,7 +31,7 @@ deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
commands = commands =
{envpython} {toxinidir}/release.py {envdir} {envsitepackagesdir} {toxinidir}/build/check_system_info_v1.0.1 {toxinidir} {envpython} {toxinidir}/release.py {envdir} {envsitepackagesdir} {toxinidir}/build/check_system_info_v1.0.2 {toxinidir}
@ -42,5 +42,5 @@ deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
commands = commands =
{envpython} {toxinidir}/release.py {envdir} {envsitepackagesdir} {toxinidir}/build/check_system_info_v1.0.1 {toxinidir} {envpython} {toxinidir}/release.py {envdir} {envsitepackagesdir} {toxinidir}/build/check_system_info_v1.0.2 {toxinidir}