Skip to content

Commit 8992d01

Browse files
author
David Straub
authored
Support STARTTLS (#364)
1 parent 8835414 commit 8992d01

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gramps_webapi/api/util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ def send_email(
247247
smtp = smtplib.SMTP_SSL(host=host, port=port, timeout=10)
248248
else:
249249
smtp = smtplib.SMTP(host=host, port=port, timeout=10)
250+
smtp.ehlo()
251+
if port != 25:
252+
smtp.starttls()
253+
smtp.ehlo()
250254
if user:
251255
smtp.login(user, password)
252256
smtp.send_message(msg)

0 commit comments

Comments
 (0)