Mailbox unavailable. The server response was: 5.7.1 Unable to relay for [email protected]

Web.config中使用如下配置
  <system.net>
    <mailSettings>
        <smtp from="[email protected]">
            <network host="localhost" port="25" />
        </smtp>
    </mailSettings>
  </system.net>

使用localhost直接发送邮件。
在服务器上部署遇到异常:Mailbox unavailable. The server response was: 5.7.1 Unable to relay for [email protected]

需要配置IIS6 Manager的SMTP server
1. Open IIS6 Manager using Control Panel => Administrative Tools.
2. Open SMTP Virtual Server properties.
3. On General tab, Set IP address of the Web server instead of "All Unassigned".
4. In Access tab, click on Relay button, this will open Relay Restrictions dialog.
5. In relay computers list, add the ip addres 127.0.0.1.

你可能感兴趣的:(available)