在asp.net web.config中设置mailsettings

时间:2013-07-02 07:33:42

标签: asp.net iis web-config smtp asp.net-membership

我正在尝试从asp.net登录页面发送注册电子邮件。但是出现了不同类型的问题

<mailSettings>
   <smtp from="mail@spiralsnet.com">
      <network host="localhost" defaultCredentials ="false" username="mail@domain.com" password="passord"/>
   </smtp>
</mailSettings>

当我使用此设置时,我收到此错误

  

Uncaught Sys.WebForms.PageRequestManagerServerErrorException:Sys.WebForms.PageRequestManagerServerErrorException:在服务器上处理请求时发生未知错误。从服务器返回的状态代码是:500

当我使用此设置时

<mailSettings>
   <smtp from="mail@domain.com">
      <network host="localhost" defaultCredentials ="true"/>
   </smtp>
</mailSettings>

它会生成错误

  

邮箱不可用

我对localhost部分感到困惑。我应该离开它还是改变它..

0 个答案:

没有答案