mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
catch SMTP exception if any - issue #311
This commit is contained in:
@@ -91,7 +91,11 @@ if CONTENT:
|
|||||||
attachment.add_header("Content-Disposition", "attachment", filename="test_case_%d_console_output.txt" % test_count)
|
attachment.add_header("Content-Disposition", "attachment", filename="test_case_%d_console_output.txt" % test_count)
|
||||||
msg.attach(attachment)
|
msg.attach(attachment)
|
||||||
|
|
||||||
s = smtplib.SMTP(host=SMTP_SERVER, port=SMTP_PORT, timeout=SMTP_TIMEOUT)
|
try:
|
||||||
#s.set_debuglevel(1)
|
s = smtplib.SMTP(host=SMTP_SERVER, port=SMTP_PORT, timeout=SMTP_TIMEOUT)
|
||||||
s.sendmail(FROM, TO, msg.as_string())
|
#s.set_debuglevel(1)
|
||||||
s.quit()
|
s.sendmail(FROM, TO, msg.as_string())
|
||||||
|
s.quit()
|
||||||
|
# Catch all for SMTP exceptions
|
||||||
|
except smtplib.SMTPException, e:
|
||||||
|
print "Failure to send email: %s" % str(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user