#16 fix starttls

This commit is contained in:
Davide Alberani 2021-10-11 20:54:46 +02:00
parent 06ac588f74
commit 3563638dab

View file

@ -315,7 +315,7 @@ def send_email(to, subject='diffido', body='', from_=None):
tls_args = {} tls_args = {}
for key in ('ssl_keyfile', 'ssl_certfile', 'ssl_context'): for key in ('ssl_keyfile', 'ssl_certfile', 'ssl_context'):
if key in args: if key in args:
tls_args[key] = (args[key] or '').replace('ssl_', '') tls_args[key.replace('ssl_', '')] = args[key]
del args[key] del args[key]
with smtplib.SMTP(**args) as s: with smtplib.SMTP(**args) as s:
if starttls: if starttls: