Skip to content

Commit

Permalink
Fix: Support non-SSL SMTP
Browse files Browse the repository at this point in the history
  • Loading branch information
cholonam committed Aug 27, 2023
1 parent 83fea25 commit c824f6c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion syslogdiag/emailing.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ def _send_msg(msg: MIMEMultipart):

# Send the message via our own SMTP server, but don't include the
# envelope header.
s = smtplib.SMTP_SSL(email_server, email_port)
s: smtplib.SMTP
try:
s = smtplib.SMTP_SSL(email_server, email_port)
except ssl.SSLError:
s = smtplib.SMTP(email_server, email_port)

try:
s.starttls()
Expand Down

0 comments on commit c824f6c

Please sign in to comment.