getting logging stuff

This commit is contained in:
b3yond 2018-03-29 00:39:45 +02:00
parent affd209a3b
commit c9fd91de74

View file

@ -30,9 +30,9 @@ class Mailer(object):
self.s = smtplib.SMTP(config["mail"]["mailserver"]) self.s = smtplib.SMTP(config["mail"]["mailserver"])
try: try:
context = ssl.create_default_context() context = ssl.create_default_context()
self.s.starttls(context=context)
except: except:
logger.error('Creating SSL Context failed.', exc_info=True) logger.error('StartTLS failed.', exc_info=True)
self.s.starttls(context=context)
self.s.login(config["mail"]["user"], config["mail"]["passphrase"]) self.s.login(config["mail"]["user"], config["mail"]["passphrase"])
def send(self, text, recipient, subject, attachment=None): def send(self, text, recipient, subject, attachment=None):