Merge pull request #1144 from fzs/logSendFailedException

Improve logging when sending email fails.