Send email from Elmah? Send email from Elmah? asp.net asp.net

Send email from Elmah?


You need the ErrorMail httpModule.

add this line inside the <httpModules> section

<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />

If you're using a remote SMTP server (which it looks like you are) you don't need SMTP on the server.


Yes, if you are not using remote SMTP server you must have SMTP Server configured locally. You can also configure email for elmah in web.config as follows:

<configSections>   <sectionGroup name="elmah">     <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler,  Elmah">     </sectionGroup></configSections> <elmah>      <errorMail from="from Mail Address" to="to mail address"                 async="true"  smtpPort="0" useSsl="true" /> </elmah><system.net>     <mailSettings>       <smtp deliveryMethod ="Network">         <network host="smtp.gmail.com" port="587" userName="yourgmailEmailAddress"   password="yourGmailEmailPassword" />       </smtp>     </mailSettings> </system.net>


I have used Elmah myself in this configuration and I had to setup the server with SMTP locally. It is a straight-forward install on you local IIS server. This should do the trick.

Good point above, you need the errorMail module BUT if you are not using a remote SMTP server you need SMTP locally, just to clarify.