Ignore SMTP exceptions (caused by empty email addresses, hrm?)
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 15 Dec 2009 17:10:30 -0500
changeset 21 97f2d5b5e686
parent 20 576078244fc5
child 22 be97dcbfb739
push id18
push userbsmedberg@mozilla.com
push dateTue, 15 Dec 2009 22:10:34 +0000
Ignore SMTP exceptions (caused by empty email addresses, hrm?)
weeklyupdates/mail.py
--- a/weeklyupdates/mail.py
+++ b/weeklyupdates/mail.py
@@ -34,16 +34,18 @@ def sendmails(messages, fromaddress=None
         try:
             session.sendmail(messagefrom, messageto, message.as_string())
         except AttributeError, e:
             print e
             try:
                 print "Exception sending mail from %r to %r" % (fromaddress, recipientlist)
             except:
                 pass
+        except smtplib.SMTPException:
+            pass
     session.quit()
 
 def sendpost(fromaddress, tolist, recipientlist, post):
     subject = "Status Update: %s on %s" % (post.username, post.postdate.isoformat())
 
     message = email.mime.multipart.MIMEMultipart('alternative')
     message['To'] = ', '.join(tolist)
     message['From'] = fromaddress