我正在发送邮件,但它给了我异常
Mailbox name not allowed. The server response was: sorry, relaying denied from your location [182.72.17.210] (#5.7.1)
我的代码
public static string SendMailHtmlFromat(string sForm, string sTo, string sSub, string sMsg)
{
MailMessage mailmsg = new MailMessage();
mailmsg.To.Add(sTo);
mailmsg.From = new MailAddress(sForm);
mailmsg.Subject = sSub;
mailmsg.IsBodyHtml = true;
mailmsg.Body = sMsg;
try
{
//SmtpClient smtp = new SmtpClient("smtpout.secureserver.net", 25);
SmtpClient smtp = new SmtpClient("relay-hosting.secureserver.net", 25);
smtp.Credentials = new System.Net.NetworkCredential("admin@beautiful.com", "Smart123");
smtp.Send(mailmsg);
}
catch (Exception e)
{ }
return "";
}
是SmtpClient声明中的任何问题
答案 0 :(得分:0)