title: Send email from Elmah?
body: <p>Is anyone using Elmah to send exceptions via email? I've got Elmah logging set up via SQL Server, and can view the errors page via the Elmah.axd page, but I am unable to get the email component working. The idea here is to get the email notification so we can react more quickly to exceptions. Here is my web.config (unnecessary sectionss omitted), with all the sensitive data replaced by * * *. Even though I am specifying a server to connect to, does the SMTP service need to be running on the local machine?</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
      &lt;configSections&gt;
          &lt;sectionGroup name="elmah"&gt;
              &lt;section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/&gt;
              &lt;section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/&gt;
              &lt;section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/&gt;
          &lt;/sectionGroup&gt;
      &lt;/configSections&gt;
      &lt;appSettings/&gt;
      &lt;connectionStrings&gt;
          &lt;add name="elmah-sql" connectionString="Data Source=***;Initial Catalog=***;Persist Security Info=True;User ID=***;Password=***" /&gt;
      &lt;/connectionStrings&gt;
  
      &lt;elmah&gt;
          &lt;errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="elmah-sql"   &gt;
          &lt;/errorLog&gt;
          &lt;errorMail from="test@test.com"
             to="test@test.com"
             subject="Application Exception"
             async="false"
             smtpPort="25"
             smtpServer="***"
             userName="***"
             password="***"&gt;
          &lt;/errorMail&gt;
      &lt;/elmah&gt;
  
      &lt;system.web&gt;        
          &lt;customErrors mode="RemoteOnly" defaultRedirect="CustomError.aspx"&gt;
              &lt;error statusCode="403" redirect="NotAuthorized.aspx" /&gt;
              &lt;!--&lt;error statusCode="404" redirect="FileNotFound.htm" /&gt;--&gt;
          &lt;/customErrors&gt;
          &lt;httpHandlers&gt;
              &lt;remove verb="*" path="*.asmx"/&gt;
              &lt;add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
              &lt;add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
              &lt;add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/&gt;
              &lt;add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /&gt;
          &lt;/httpHandlers&gt;
          &lt;httpModules&gt;
              &lt;add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
              &lt;add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/&gt;
          &lt;/httpModules&gt;
      &lt;/system.web&gt;
  
  &lt;/configuration&gt;
  </code></pre>