Improves the robustness of the SMTP error handling utilities. Fixes bug #1409. Commit ready for merge.

- Legacy-Id: 7766
This commit is contained in:
Robert Sparks 2014-05-22 01:28:33 +00:00
parent e9984b957b
commit 393422b36b

View file

@ -306,7 +306,7 @@ def smtp_error_user_warning(thing,request):
if request:
warning = "An error occured while sending email:\n"
if (e.original_msg):
if getattr(e,'original_msg',None):
warning += "Subject: %s\n" % e.original_msg.get('Subject','[no subject]')
warning += "To: %s\n" % e.original_msg.get('To','[no to]')
warning += "Cc: %s\n" % e.original_msg.get('Cc','[no cc]')