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"])
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):