ELMAH不发送电子邮件IIS 7.5 [英] ELMAH not sending email IIS 7.5

查看:122
本文介绍了ELMAH不发送电子邮件IIS 7.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在stackoverflow和互联网上找到的所有可能的设置,但没有运气。希望ELMAH的开发人员有洞察力来显示ELMAH本身的消息。 ELMAH xml日志记录工作正常。



希望有人在这里指出web.config中的错误配置

 < configSections> 
< sectionGroup name =elmah>
< section name =securityrequirePermission =falsetype =Elmah.SecuritySectionHandler,Elmah/>
< section name =errorLogrequirePermission =falsetype =Elmah.ErrorLogSectionHandler,Elmah/>
< section name =errorMailrequirePermission =falsetype =Elmah.ErrorMailSectionHandler,Elmah/>
< section name =errorFilterrequirePermission =falsetype =Elmah.ErrorFilterSectionHandler,Elmah/>
< / sectionGroup>

< / configSections>


< modules runAllManagedModulesForAllRequests =true>
< remove name =ErrorLog/>
< remove name =ErrorMail/>
< add name =ErrorLogtype =Elmah.ErrorLogModule,Elmah/>
< add name =ErrorMailtype =Elmah.ErrorMailModule,ElmahpreCondition =managedHandler/>
< / modules>

< errorMail from =from emailto =to emailsubject =elmah exceptionsmtpServer =smtp.gmail.comport =587userName =xxxx @ gmail。 compassword =gmailpassworduseSsl =trueasync =true>
< / errorMail>

尝试使用没有@gmail的用户名。已尝试本地安装的服务器在errorMail设置,但没有帮助。本地安装的服务器工作正常。



还尝试过:

 < system.net> 
< mailSettings>
< smtp deliveryMethod =Network>
< network host =smtp.gmail.comport =587userName =xxxxxxxxxxxpassword =xxxxx/>
< / smtp>
< / mailSettings>
< /system.net>

使用本地smtp服务器的这些设置:



< smtpServer =xxx smtpserver的IP地址port =25userName =xxxxx password =xxxxasync =true>
< / errorMail>总而言之,我已尝试所有的组合,不同的设置,不同的SMTP服务器....没有运气。不知道ELMAH的某个地方是否存在某些信息,我可以看到为什么ELMAH不能连接到STMP。



如上所述,我经历了每篇文章这个网站谈论了ELMAH电子邮件,并遵循说明...但仍然无法使其工作。



还尝试了本地smtp拾取目录

 < smtp deliveryMethod =specifiedPickupDirectory> 
< specifiedPickupDirectory pickupDirectoryLocation =C:\inetpub\mailroot\Pickup/>
< / smtp>

并监视目录。在文件夹中看不到活动。



使用ELMAH 1.2

解决方案

本文介绍如何捕获ELMAH的内部错误: http://ericmbarnard.blogspot。 co.uk/2012/07/debugging-elmah-on-azure.html



几分钟前我刚刚救了我,告诉我为什么我的日志记录到SQL不工作:-)虽然它提到Azure,您可以使用与本地调试相同的技术,您将能够写入调试跟踪侦听器,并避免写入数据库。


Tried every possible setting found on stackoverflow and the Internet but no luck. Wish the developer of ELMAH had insight to show messages from ELMAH itself. ELMAH xml logging works fine.

Hope someone here will point out misconfiguration in web.config

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


<modules runAllManagedModulesForAllRequests="true">
  <remove name="ErrorLog" />
  <remove name="ErrorMail" />
  <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
  <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
</modules>

<errorMail from="from email" to="to email" subject="elmah exception" smtpServer="smtp.gmail.com" port="587" userName="xxxx@gmail.com" password="gmailpassword" useSsl="true" async="true"  >
</errorMail>

Have tried user name without @gmail. Have tried locally installed server in errorMail settings but no help. The locally installed server works fine otherwise.

Have also tried this:

<system.net> 
    <mailSettings> 
      <smtp deliveryMethod="Network"> 
        <network host="smtp.gmail.com" port="587" userName="xxxxxxxxxxx" password="xxxxx" /> 
      </smtp> 
    </mailSettings> 
</system.net>

used these settings for local smtp server:

<errorMail from="from email" to="to email" subject="elmah exception" smtpServer="xxx IP address of smtpserver" port="25" userName="xxxxx" password="xxxx" async="true"  >
</errorMail>

All in all, I have tried all combinations, different settings, different SMTP servers.... no luck. Don't know if there is some message somewhere from ELMAH that I can see to know why ELMAH not connecting to STMP.

As stated above, I went through every post on this site that talks about ELMAH email and followed the instructions... but still couldn't make it work.

Also tried local smtp pickup directory

<smtp deliveryMethod="specifiedPickupDirectory">
        <specifiedPickupDirectory pickupDirectoryLocation="C:\inetpub\mailroot\Pickup"  />
      </smtp>

and monitored the directory. Saw no activity in the folder.

Using ELMAH 1.2

解决方案

This article explains how to capture the internal error of ELMAH: http://ericmbarnard.blogspot.co.uk/2012/07/debugging-elmah-on-azure.html

It just saved me a few minutes ago by telling me why my logging to SQL wasn't working :-) Although it mentions Azure you can use the same technique with local debugging, and you'll be able to write to the debug trace listener and avoid having to write to a database.

这篇关于ELMAH不发送电子邮件IIS 7.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆