2013-02-24 49 views
4

嘗試在stackoverflow和互聯網上找到每一個可能的設置,但沒有運氣。希望ELMAH的開發者能夠洞察ELMAH本身的消息。 ELMAH XML記錄工作正常。ELMAH不發送電子郵件IIS 7.5

希望這裏有人會指出錯誤配置在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="[email protected]" 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

+1

不幸的是我也遇到了這個問題。 – MushinNoShin 2013-03-06 11:52:47

回答

0

本文介紹瞭如何捕捉ELMAH的內部錯誤:http://ericmbarnard.blogspot.co.uk/2012/07/debugging-elmah-on-azure.html

它只是救了我幾分鐘前告訴我爲什麼我的日誌記錄到SQL不工作: - )雖然它提到了Azure,但您可以在本地調試中使用相同的技術,並且您可以寫入調試跟蹤偵聽器並避免寫入數據庫。

+0

我不明白downvote?這將告訴您如何跟蹤ELMAH內部可能發生的錯誤。這特別回答了「希望ELMAH的開發者能夠洞察ELMAH本身的消息......」。我已經證實這是有效的。如果郵件本身存在質量問題 - 請說明性質,以便我可以糾正錯誤,並且不會在將來犯同樣的錯誤。謝謝RobD。 – RobD 2013-12-30 12:31:19

+1

也許是因爲該頁面不存在 - 它是404? – philw 2014-04-16 15:08:54

+0

啊!感謝philw我更新了這篇文章 – RobD 2014-04-17 09:58:49