getting logging stuff
This commit is contained in:
parent
affd209a3b
commit
c9fd91de74
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue