extend smtplib error

This commit is contained in:
dadokkio 2021-03-11 14:42:59 +01:00
parent 4b7f8ec0e5
commit e002b05e3d

View File

@ -90,7 +90,11 @@ class Mailer(Responder):
server.ehlo()
server.login(self.smtp_user, self.smtp_pwd)
server.send_message(msg, self.mail_from, [mail_to])
except (smtplib.SMTPNotSupportedError, ssl.SSLCertVerificationError):
except (
smtplib.SMTPNotSupportedError,
ssl.SSLCertVerificationError,
smtplib.SMTPException,
):
with smtplib.SMTP(self.smtp_host, self.smtp_port) as server:
server.ehlo()
server.login(self.smtp_user, self.smtp_pwd)