fix SMTP connectivity test, appendum to a8d0670

This commit is contained in:
Martin Zimmermann 2013-10-27 12:47:48 +01:00
parent 94b1fef28e
commit acbf42f89d

View File

@ -58,6 +58,10 @@ class SMTPMailer(object):
self.from_addr = conf.get('SMTP', 'from') self.from_addr = conf.get('SMTP', 'from')
self.to_addr = conf.get('SMTP', 'to') self.to_addr = conf.get('SMTP', 'to')
# test SMTP connectivity
with Connection(self.conf):
pass
def sendmail(self, subject, body): def sendmail(self, subject, body):
msg = MIMEText(body, 'plain', 'utf-8') msg = MIMEText(body, 'plain', 'utf-8')