Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
<configuration>
  <configSections>
    <sectionGroup name="elmah">
      <section name="security" requirePermission="false"
	type="Elmah.SecuritySectionHandler, Elmah" />
      <section name="errorLog" requirePermission="false"
	type="Elmah.ErrorLogSectionHandler, Elmah" />
      <section name="errorMail" requirePermission="false"
	type="Elmah.ErrorMailSectionHandler, Elmah" />
      <section name="errorFilter" requirePermission="false"
	type="Elmah.ErrorFilterSectionHandler, Elmah" />
    </sectionGroup>
  </configSections>
 <connectionStrings>
    <add name="ApplicationServices" connectionString="Data Source=adpro-PC;Initial Catalog=demoproject;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <elmah>
<security allowRemoteAccess="0" />
    <errorLog type="Elmah.SqlErrorLog, Elmah"
             connectionStringName="ApplicationServices" />
    <errorMail
            from="****@gmail.com"
            to="****@gmail.com"
            subject="ERROR From Elmah:"
            async="true"
            smtpPort="587"
            smtpServer="smtp.gmail.com"
            userName="my@account"
            password="mypassword" />
   </elmah>
  <system.web>
    <pages enableSessionState = "true" />
    <customErrors mode="RemoteOnly" defaultRedirect="~/Errors/ReviewErrors.aspx.cs"/>
    <compilation debug="true" targetFramework="4.0"/>
    <httpHandlers>
      <add verb="POST,GET,HEAD" path="elmah.axd"
	type="Elmah.ErrorLogPageFactory, Elmah" />
    </httpHandlers>
    <httpModules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
      <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
      </httpModules>
</system.web>
<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
      <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
      <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
       </modules>
    <handlers>
      <add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
    </handlers>
  </system.webServer>

<system.net>
    <mailSettings>
      <smtp from="****@gmail.com">
        <network defaultCredentials="false"
             userName="****@gmail.com"
             password="****"
             host="smtp.gmail.com"
             port="587"/>
      </smtp>
    </mailSettings>
  </system.net>
<configuration>
Posted
Updated 11-Jun-14 3:25am
v5
Comments
Kornfeld Eliyahu Peter 11-Jun-14 9:23am    
Do not post your email with or without password - I just visited that account!!! It also can invite spam...
srikanth492 11-Jun-14 9:26am    
thanks for remind ....i forget..
Richard MacCutchan 11-Jun-14 9:26am    
What is the problem?
srikanth492 11-Jun-14 9:28am    
email code is not working
Richard MacCutchan 11-Jun-14 12:10pm    
Saying "it is not working" is of no use whatever. Please make an effort to provide some proper details about your problem, what happens when you run your code, what results you expect, and what results you see. We cannot guess what is happening on your system.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900