我是想在我的程序impliment電子郵件選項發送電子郵件.. 的follwing異常被拋出錯誤,而試圖在asp.net
+$exception {"The server rejected one or more recipient addresses. The server response
was: 550 5.7.1 <"mail-id">... Relaying denied. IP name lookup failed [172.25.9.23]\r\n"}
System.Exception {System.Web.HttpException}
這是我做了什麼.... ..
MailMessage objEmail = new MailMessage();
objEmail.To = txtTo.Text;
objEmail.From = txtFrom.Text;
objEmail.Cc = txtCC.Text;
objEmail.Subject = txtSubject.Text;
objEmail.Body = txtBody.Text; ;
objEmail.Priority = MailPriority.High;
WebMsgBox.Show("test");
SmtpMail.SmtpServer = "someserver.com";
MailAttachment attach = new MailAttachment(@"D:\email.txt");
objEmail.Attachments.Add(attach);
try
{
SmtpMail.Send(objEmail);
WebMsgBox.Show("Your Email has been sent sucessfully - Thank you");
}
catch (Exception exc)
{
WebMsgBox.Show("Send failure: " + exc.ToString());
}
您是否檢查了所有收件人地址?確保它們拼寫正確。 – Amr