我正在尝试从 asp.net登录页面发送注册电子邮件。但控制台显示此错误..
Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Mailbox unavailable. The server response was: Delivery is not allowed to this address.
导致此错误,代码或 stmp服务器的错误配置的原因。我在商业服务器上托管而不是我自己的。
答案 0 :(得分:0)
试 yourClientName.DeliveryMethod = SmtpDeliveryMethod.Network;
例如:
SmtpClient client;
client = new SmtpClient("smtp.myserver.com", 25);
if (!string.IsNullOrEmpty(""))
{
System.Net.NetworkCredential credential = new NetworkCredential("", "");
client.Credentials = credential;
}
client.UseDefaultCredentials = true;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
了解更多详情: http://msdn.microsoft.com/en-us/library/system.net.mail.smtpdeliverymethod.aspx