我正在使用relay-hosting.secureserver.net作为 smtp 服务器,但出现以下错误:不允许使用邮箱名称。服务器响应是:抱歉,从您的位置拒绝中继 [212.78.237.157] (#5.7.1)
我需要更改 smtp 设置或其他任何东西吗?
这是代码:
var mailClient = new SmtpClient();
mailClient.Credentials = new NetworkCredential { UserName = "alerts@mycloudcctv.com", Password = "xyz" };
mailClient.Host = "relay-hosting.secureserver.net";
mailClient.EnableSsl = false;
mailClient.DeliveryMethod=SmtpDeliveryMethod.Network;
var mail = new MailMessage("alerts@mycloudcctv.com", "azharmalik3@yahoo.com", "Test Smtp server", "Testing mycloudcctv server") { IsBodyHtml = true };
mailClient.Send(mail);