Fix SMTP exception when an email is send to the moderator.

svn path=/plone.app.discussion/trunk/; revision=46013
This commit is contained in:
Timo Stollenwerk
2010-11-29 08:27:09 +00:00
parent e3eaef18b8
commit b26d5a5a62
2 changed files with 17 additions and 8 deletions
+14 -8
View File
@@ -307,11 +307,14 @@ def notify_moderator(obj, event):
if PLONE_4:
try:
mail_host.send(message, mto, sender, subject, charset='utf-8')
except SMTPException:
logger.error('SMTP exception while trying to send an ' +
'email from %s to %s',
except SMTPException, e:
logger.error('SMTP exception (%s) while trying to send an ' +
'email notification to the comment moderator ' +
'(from %s to %s, message: %s)',
e,
sender,
comment.author_email)
mto,
message)
else: # pragma: no cover
try:
mail_host.secureSend(message,
@@ -319,8 +322,11 @@ def notify_moderator(obj, event):
sender,
subject=subject,
charset='utf-8')
except SMTPException:
logger.error('SMTP exception while trying to send an ' +
'email from %s to %s',
except SMTPException, e:
logger.error('SMTP exception (%s) while trying to send an ' +
'email notification to the comment moderator ' +
'(from %s to %s, message: %s)',
e,
sender,
comment.author_email)
mto,
message)