setting up mailsettings in asp.net web.config

纵然是瞬间 提交于 2020-01-07 05:49:25

问题


I am trying to send registration email from asp.net login page. but there appear different type of issues

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

when I use this setting I get this error

Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

When I use this settings

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

the it generates the error

mailbox unavailable

I am confused about the localhost part. should I leave it or change it..

来源:https://stackoverflow.com/questions/17419962/setting-up-mailsettings-in-asp-net-web-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!