Search code examples
c#asp.netelmah

elmah - not sending email in production


I have an ASP.NET MVC 4 web application and I would like to implement sending exceptions to my email including all necessary information (referer, etc.). I do not want to store exceptions in database or files. Last project I used elmah and it worked like a charm.

In current project I face to one problem. I installed and configured elmah and on localhost (IIS Express 10.0; .NET Framework 4.0; ASP.NET: 4.6) it works pretty good. All exceptions are sent to my email. So mail connection credentials in web.config are OK.

But on production server (IIS 8.5; .NET Framework: 4.0; ASP.NET: 4.7) elmah sends nothing when exception occurs and I have no idea why. Is there any chance to get to know why?

I tested mail connection from production server to mail server by telnet and mail server is reachable.

So: 1. web.config should be OK - emails are sent on localhost 2. telnet connection to mailserver is reachable - so no firewall issue, etc.

What else can I do? How to debug elmah?


Solution

  • After few hours of debugging it turned out that external mail server was configured to reject sending email from specific user from specific IP.