Export to GitHub

elmah - issue #403

ELMAH not logging System.FormatException thrown by System.Net.Mail.MailMessage.To.Add()


Posted on Dec 17, 2015 by Quick Lion

I have an MVC 3 web application with an action method that sends an email. When the action method calls MailMessage.To.Add with multiple email addresses separated by semicolons (;), .NET throws a System.FormatException: “An invalid character was found in the mail header: ';'.”

ELMAH did not log the error thrown. I have tried this many times and it was never logged. Other exceptions get logged as expected, but this one is not.

I am using version 1.2.2 of ELMAH core and logging errors to the database.

Please help.

Thanks

Status: New

Labels:
Type-Defect Priority-Medium