From f268fcfd480527cfd57ba9585d4bbacdac1c6244 Mon Sep 17 00:00:00 2001 From: b3yond Date: Thu, 29 Mar 2018 00:39:45 +0200 Subject: [PATCH] getting logging stuff --- sendmail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sendmail.py b/sendmail.py index 38b4b24..992ff1a 100755 --- a/sendmail.py +++ b/sendmail.py @@ -30,9 +30,9 @@ class Mailer(object): self.s = smtplib.SMTP(config["mail"]["mailserver"]) try: context = ssl.create_default_context() + self.s.starttls(context=context) except: - logger.error('Creating SSL Context failed.', exc_info=True) - self.s.starttls(context=context) + logger.error('StartTLS failed.', exc_info=True) self.s.login(config["mail"]["user"], config["mail"]["passphrase"]) def send(self, text, recipient, subject, attachment=None):