parent
5945271166
commit
58678b4504
1 changed files with 4 additions and 0 deletions
|
@ -13,6 +13,10 @@ def send_mail(sender: str, recipient: str, subject: str, body: str) -> None:
|
|||
smtp = smtplib.SMTP(
|
||||
config.config["smtp"]["host"], int(config.config["smtp"]["port"])
|
||||
)
|
||||
try:
|
||||
smtp.starttls()
|
||||
except smtplib.SMTPNotSupportedError:
|
||||
pass
|
||||
smtp.login(config.config["smtp"]["user"], config.config["smtp"]["pass"])
|
||||
smtp.send_message(msg)
|
||||
smtp.quit()
|
||||
|
|
Loading…
Reference in a new issue