Except on MTA error and continue.
authorFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Wed, 17 Jan 2007 16:03:30 +0000 (16:03 +0000)
committerFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Wed, 17 Jan 2007 16:03:30 +0000 (16:03 +0000)
mailer.py

index 8df3b98..dc0799d 100755 (executable)
--- a/mailer.py
+++ b/mailer.py
@@ -4,7 +4,7 @@
 #
 # Faiyaz Ahmed <faiyaza@cs.princeton.edu>
 #
-# $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