From 2901cc0eef82ed312d724ed4bb6ee3511f12299a Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Wed, 17 Jan 2007 16:03:30 +0000 Subject: [PATCH] Except on MTA error and continue. --- mailer.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mailer.py b/mailer.py index 8df3b98..dc0799d 100755 --- a/mailer.py +++ b/mailer.py @@ -4,7 +4,7 @@ # # Faiyaz Ahmed # -# $Id: $ +# $Id: mailer.py,v 1.4 2006/11/14 19:20:13 faiyaza Exp $ from emailTxt import * import smtplib import config @@ -63,9 +63,12 @@ def email (subject, text, to): msg = out.getvalue() out.close() if not config.debug: - server = smtplib.SMTP(MTA) - server.sendmail(FROM, to, msg) - server.quit() + try: + server = smtplib.SMTP(MTA) + server.sendmail(FROM, to, msg) + server.quit() + except Exception, err: + print "Mailer error: %s" % err if __name__=="__main__": import smtplib -- 2.43.0