1 Commits
0.0.3 ... 0.0.4

Author SHA1 Message Date
086a3fc0ce Use TLS if available when sending emails 2019-11-19 15:22:05 +01:00
2 changed files with 5 additions and 1 deletions

View File

@@ -26,6 +26,10 @@ process = None
def smtp_send(smtp_host, smtp_port, mailfrom, recipient, mail): def smtp_send(smtp_host, smtp_port, mailfrom, recipient, mail):
s = smtplib.SMTP(host=smtp_host, port=smtp_port) s = smtplib.SMTP(host=smtp_host, port=smtp_port)
s.ehlo()
if s.has_extn("STARTTLS"):
s.starttls()
s.ehlo()
s.sendmail(mailfrom, [recipient], mail) s.sendmail(mailfrom, [recipient], mail)
s.quit() s.quit()

View File

@@ -1 +1 @@
__version__ = "0.0.3" __version__ = "0.0.4"