<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>

[{'answer_id': 34434, 'author': 'Rob Bazinet', 'author_id': 2305, 'author_profile': 'https://Stackoverflow.com/users/2305', 'pm_score': 3, 'selected': False, 'text': '<p>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.</p>\n\n<p>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.</p>\n'}, {'answer_id': 34435, 'author': 'TonyB', 'author_id': 3543, 'author_profile': 'https://Stackoverflow.com/users/3543', 'pm_score': 7, 'selected': True, 'text': '<p>You need the ErrorMail httpModule.</p>\n\n<p>add this line inside the &lt;httpModules&gt; section</p>\n\n<pre><code>&lt;add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /&gt;\n</code></pre>\n\n<p>If you\'re using a remote SMTP server (which it looks like you are) you don\'t need SMTP on the server.</p>\n'}, {'answer_id': 7254040, 'author': 'Anand Patel', 'author_id': 840003, 'author_profile': 'https://Stackoverflow.com/users/840003', 'pm_score': 6, 'selected': False, 'text': '<p>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:</p>\n\n<pre><code>&lt;configSections&gt;\n   &lt;sectionGroup name="elmah"&gt;\n     &lt;section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler,  Elmah"&gt; \n    &lt;/sectionGroup&gt;\n&lt;/configSections&gt; \n\n&lt;elmah&gt; \n     &lt;errorMail from="from Mail Address" to="to mail address" \n                async="true"  smtpPort="0" useSsl="true" /&gt; \n&lt;/elmah&gt;\n\n&lt;system.net&gt; \n    &lt;mailSettings&gt; \n      &lt;smtp deliveryMethod ="Network"&gt; \n        &lt;network host="smtp.gmail.com" port="587" userName="yourgmailEmailAddress"   password="yourGmailEmailPassword" /&gt; \n      &lt;/smtp&gt; \n    &lt;/mailSettings&gt; \n&lt;/system.net&gt;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/34401', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1284/']