Update mail.py

如果认证密码为空,则跳过SMTP认证
pull/251/head
d9394 2021-05-10 14:19:43 +08:00 committed by GitHub
parent 5f1a3d0f25
commit 2caf5eb02d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -119,7 +119,8 @@ def tp_send_mail(recipient, message, subject=None, sender=None, cc=None, bcc=Non
except:
pass
_smtp.login(_username, _password)
if _password is not None:
_smtp.login(_username, _password)
_smtp.set_debuglevel(0)
send_errors = _smtp.sendmail(