We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3dd9f29 commit fb752e6Copy full SHA for fb752e6
extra/shutils/regressiontest.py
@@ -91,7 +91,11 @@
91
attachment.add_header("Content-Disposition", "attachment", filename="test_case_%d_console_output.txt" % test_count)
92
msg.attach(attachment)
93
94
- s = smtplib.SMTP(host=SMTP_SERVER, port=SMTP_PORT, timeout=SMTP_TIMEOUT)
95
- #s.set_debuglevel(1)
96
- s.sendmail(FROM, TO, msg.as_string())
97
- s.quit()
+ try:
+ s = smtplib.SMTP(host=SMTP_SERVER, port=SMTP_PORT, timeout=SMTP_TIMEOUT)
+ #s.set_debuglevel(1)
+ s.sendmail(FROM, TO, msg.as_string())
98
+ s.quit()
99
+ # Catch all for SMTP exceptions
100
+ except smtplib.SMTPException, e:
101
+ print "Failure to send email: %s" % str(e)
0 commit comments