From 49bb6eada34233253bce1d793220546e78cf1670 Mon Sep 17 00:00:00 2001 From: halliday Date: Tue, 19 Mar 2024 18:56:38 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E7=9A=84=E8=BA=AB=E4=BB=BD=E8=AE=A4=E8=AF=81=202=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E4=BB=B6=E4=BA=BA=E4=B8=BA=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E7=9A=84=E7=AC=AC=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=203=E3=80=81=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Changes.txt | 3 +++ bin/get_system_info.py | 4 +++- tox.ini | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Changes.txt b/Changes.txt index 6a1ce7e..190c008 100644 --- a/Changes.txt +++ b/Changes.txt @@ -1,6 +1,9 @@ changes log ====================================== +------------------------------ +1.0.2 2024-03-19 +增加发送邮件的身份认证 ------------------------------ 1.0.1 2023-11-28 diff --git a/bin/get_system_info.py b/bin/get_system_info.py index c176047..86bf9e8 100644 --- a/bin/get_system_info.py +++ b/bin/get_system_info.py @@ -42,7 +42,7 @@ need_sendmail = False def send_mail(): # 发件人 - sender = 'mh@unamail.com' + sender = config["receivers"][0] # 接收邮件,可以发给多人 receivers = config["receivers"] # 邮件主体 @@ -72,6 +72,8 @@ def send_mail(): try: smtpObj = smtplib.SMTP('10.10.110.102') + #身份认证 + smtpObj.login(sender,"111111") smtpObj.sendmail(sender, receivers, msg.as_string()) print("邮件发送成功") except smtplib.SMTPException: diff --git a/tox.ini b/tox.ini index 1a1bf50..5fbef08 100644 --- a/tox.ini +++ b/tox.ini @@ -31,7 +31,7 @@ deps = -r{toxinidir}/requirements.txt 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 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}