Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 3 Elmah不发送电子邮件_Asp.net Mvc 3_Asp.net Mvc 4_Elmah - Fatal编程技术网

Asp.net mvc 3 Elmah不发送电子邮件

Asp.net mvc 3 Elmah不发送电子邮件,asp.net-mvc-3,asp.net-mvc-4,elmah,Asp.net Mvc 3,Asp.net Mvc 4,Elmah,我已经在Mvc4应用程序中实现了Elmah。我的web.config如下所示:- <configuration> <configSections> <sectionGroup name="elmah"> <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />

我已经在Mvc4应用程序中实现了Elmah。我的web.config如下所示:-

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

    <elmah>
        <security allowRemoteAccess="1" />
        <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data"/>
        <errorMail from="test@test.in" to="test1@test.in" subject="Elmah Report" async="true" smtpServer="mail.test.in" />            
    </elmah>

  <connectionStrings>
    <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-Mvcjquery-20130225111502;Integrated Security=SSPI" />
  </connectionStrings>   

    <system.web>
      <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="Elmah.ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
          <add name="Elmah.ErrorMail" type="Elmah.ErrorMailModule" preCondition="managedHandler" />
      </modules>

      <handlers>
          <add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />         
      </handlers>
  </system.webServer>    

</configuration>

我添加了通过elmah发送电子邮件的代码。我可以通过键入url查看错误localhost://elmah.axd.But 我没有收到邮件。请帮助尝试
async=“false”



我收到一个异常“SmtpException未被用户代码处理”。发送邮件失败。好的,请查看InnerException。您配置的SMTP服务器可能有问题。是..这是我的SMTP服务器的问题。谢谢您的回答。将async设置为false会改变用户对网站的操作吗?艾玛还会默默地失败吗?
<errorMail 
    from="join@assert.in" 
    to="twinkle@assert.in" 
    subject="Elmah Report" 
    async="false" 
    smtpServer="mail.assert.in" />