Guest User

Untitled

a guest
Aug 17th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. Unable to configure mail for Elmah
  2. <configSections>
  3. <sectionGroup name="elmah">
  4. <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
  5. <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
  6. <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
  7. <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
  8. </sectionGroup>
  9. </configSections>
  10. <mailSettings>
  11. <smtp deliveryMethod="Network">
  12. <network host="smtp.gmail.com"
  13. port="587"
  14. userName="example@gmail.com"
  15. password="password" />
  16. </smtp>
  17. </mailSettings>
  18. </system.net>
  19. <elmah>
  20. <errorMail
  21. from="example1@gmail.com"
  22. to="example2@gmail.com"
  23. sync="true"
  24. smtpPort="0"
  25. useSsl="true"
  26. />
  27. </elmah>
  28.  
  29. <?xml version="1.0"?>
  30. <configuration>
  31. <configSections>
  32. <!--ELMAH-->
  33. <sectionGroup name="elmah">
  34. <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/>
  35. <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/>
  36. <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/>
  37. <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/>
  38. </sectionGroup>
  39. </configSections>
  40. <elmah>
  41. <security allowRemoteAccess="1"/>
  42. <!-- set the smtpPort attribute to "0". Doing so will cause ELMAH to use the port defined per the <system.net> settings -->
  43. <errorMail from="example1@gmail.com" to="example2@gmail.com" subject="ERROR(test):" async="false" smtpPort="0" useSsl="true" />
  44. </elmah>
  45. <!--System.net Mail setup-->
  46. <system.net>
  47. <mailSettings>
  48. <smtp deliveryMethod="network">
  49. <network host="smtp.gmail.com" port="587" userName="example1@gmail.com" password="..." />
  50. </smtp>
  51. </mailSettings>
  52. </system.net>
  53. <appSettings>
  54. ...
  55. </appSettings>
  56. <connectionStrings>
  57. ...
  58. </connectionStrings>
  59. <system.web>
  60. <compilation debug="true">
  61. <assemblies>
  62. ...
  63. </compilation>
  64. <customErrors mode="Off"/>
  65. ...
  66. <httpHandlers>
  67. ...
  68. <!--ELMAH-->
  69. <add verb="POST,GET,HEAD" path="MyErrorPage/elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
  70. </httpHandlers>
  71. <httpModules>
  72. ...
  73. <!-- ELMAH: Logging module -->
  74. <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
  75. <!-- <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/> -->
  76. <!--<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>-->
  77. </httpModules>
  78. <httpRuntime maxRequestLength="458292"/>
  79. <authentication mode="Forms">
  80. ...
  81. </authentication>
  82. ...
  83. </system.web>
  84. <location path="MyErrorPage.aspx">
  85. <system.web>
  86. <authorization>
  87. <allow users="?"/>
  88. </authorization>
  89. </system.web>
  90. </location>
  91. <!--
  92. The system.webServer section is required for running ASP.NET AJAX under Internet
  93. Information Services 7.0. It is not necessary for previous version of IIS.
  94. -->
  95. <system.webServer>
  96. <validation validateIntegratedModeConfiguration="false"/>
  97. <modules runAllManagedModulesForAllRequests="true">
  98. ...
  99. <!-- ELMAH-->
  100. <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
  101. <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
  102. <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
  103. </modules>
  104. <handlers>
  105. ...
  106. <!--ELMAH-->
  107. <add name="Elmah" verb="POST,GET,HEAD" path="MyErrorPage/elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
  108. </handlers>
  109. </system.webServer>
  110. <runtime>
  111. <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  112. ...
  113. </assemblyBinding>
  114. </runtime>
  115. <location path="MyErrorPage/elmah.axd">
  116. <system.web>
  117. <authorization>
  118. <deny users="?"/>
  119. <allow users="?"/>
  120. </authorization>
  121. </system.web>
  122. </location>
  123. </configuration>
  124.  
  125. <system.net>
  126. <mailSettings>
  127. <smtp deliveryMethod="Network">
  128. <network host="smtp.gmail.com" defaultCredentials="false"
  129. port="587" userName ="yourMailId@gmail.com" password="yourMailPassword" />
  130. </smtp>
  131. </mailSettings>
  132. </system.net>
Add Comment
Please, Sign In to add comment