我有一个Azure网站,我想从这个网站发送电子邮件。我正在使用我的内部部署交换服务器(它有一个公共IP):
SmtpClient smtp = new SmtpClient
{
Host = "myserver.com",
Port = 25,
UseDefaultCredentials = false,
Credentials = new NetworkCredential("myemail@myserver.com", "mypassword"),
DeliveryMethod = SmtpDeliveryMethod.Network
};
但smtp.send
函数失败,并显示以下错误消息:The server response was: 5.7.1 Unable to relay
错误