信箱不可用。服务器响应为:5.7.1 无法中继

Mailbox unavailable. The server response was: 5.7.1 Unable to relay

相同 ASP.NET MVC 4 网站,相同的邮件发送代码。从 AccountController 发送电子邮件消息不再有效,从所有其他控制器发送电子邮件。

这是我从 AccountController 操作中得到的错误:

Cannot send e-mail from noreply@domain.com to bill@microsoft.com
Exception: Mailbox unavailable. The server response was: 5.7.1 Unable to relay.
mail.domain.com, SMTPSVC/mail.domain.com, 25, 

我应该检查什么?它多年来一直有效,但最近 Windows Server 2008 / Exchange 2010 更新不再有效。

MailMessage message = new MailMessage(fromAddress, toAddress)
{
   Subject = subject,
   Body = body,
   IsBodyHtml = isHtml
};

try
{
   smtpClient.Send(message);

   string errorMsg = "Sending e-mail from " + fromAddress.Address + " to " + originalAddresses[i];
   errorMsg += Environment.NewLine;
   errorMsg += smtpClient.Host + ", " + smtpClient.TargetName + ", " + smtpClient.Port + ", " + smtpClient.ClientCertificates + ", " + smtpClient.EnableSsl + ", " + smtpClient.UseDefaultCredentials + ", " + smtpClient.Timeout;

   sw.WriteLine(errorMsg)
}
catch (Exception ex)
{
   string errorMsg = "Cannot send e-mail from " + fromAddress.Address + " to " + originalAddresses[i] + ", " + "Exception: " + ex.Message +
                                (ex.InnerException != null ? ", " + ex.InnerException.Message : string.Empty);
   errorMsg += Environment.NewLine;
   errorMsg += smtpClient.Host + ", " + smtpClient.TargetName + ", " + smtpClient.Port + ", " + smtpClient.ClientCertificates + ", " + smtpClient.EnableSsl + ", " + smtpClient.UseDefaultCredentials + ", " + smtpClient.Timeout;

   sw.WriteLine(errorMsg);

   return false;
}

知道我应该检查什么吗? AccountController 有什么我应该关心的特别的东西吗? [RequireHttps] controller action 属性有点牵扯吗?

谢谢。

编辑1:

这是我们的 Exchange 2010 设置(请注意,我们可以从其他 ASP.NET MVC 控制器发送 相同的 电子邮件消息:

https://practical365.com/exchange-server/how-to-configure-a-relay-connector-for-exchange-server-2010/

EDIT2:

我错了,问题不是 ASP.NET MVC 控制器相关,而是电子邮件地址域相关。我发现我们总是包含一个不属于我们公司域(外部互联网)的电子邮件地址,我们会收到上述错误。那么现在的问题是:为什么 Exchange 2010 接收连接器现在无法向外部 Internet 发送电子邮件通知?

服务器场更改了我们服务器的传出 IP 地址,这阻止了所有包含不在我们公司域中的收件人的电子邮件。将新的传出 IP 地址添加到 Properties->Network->Receive mail from remote servers that have these IP addresses 下的 Exchange 2010 接收连接器解决了问题。