Use TLS if available when sending emails
This commit is contained in:
@@ -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()
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = "0.0.3"
|
__version__ = "0.0.4"
|
||||||
|
|||||||
Reference in New Issue
Block a user