【发布时间】:2013-02-10 00:42:09
【问题描述】:
尝试了在 stackoverflow 和 Internet 上找到的所有可能设置,但没有成功。希望 ELMAH 的开发者有洞察力来显示来自 ELMAH 本身的消息。 ELMAH xml 日志记录工作正常。
希望这里有人指出 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>
已尝试不带@gmail 的用户名。已尝试在 errorMail 设置中本地安装服务器,但没有帮助。否则,本地安装的服务器工作正常。
也试过这个:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="smtp.gmail.com" port="587" userName="xxxxxxxxxxx" password="xxxxx" />
</smtp>
</mailSettings>
</system.net>
将这些设置用于本地 smtp 服务器:
<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>
总而言之,我已经尝试了所有组合、不同的设置、不同的 SMTP 服务器......但没有运气。不知道是否有来自 ELMAH 的某处消息让我知道为什么 ELMAH 没有连接到 STMP。
如上所述,我浏览了该网站上所有关于 ELMAH 电子邮件的帖子并按照说明进行操作...但仍然无法正常工作。
还尝试了本地 smtp 提取目录
<smtp deliveryMethod="specifiedPickupDirectory">
<specifiedPickupDirectory pickupDirectoryLocation="C:\inetpub\mailroot\Pickup" />
</smtp>
并监视目录。在文件夹中没有看到任何活动。
使用 ELMAH 1.2
【问题讨论】:
-
不幸的是,我也遇到了这个问题。