đây là mã của tôiSmtpClient "thất bại gửi thư"
for(int i = 0; i < number ; i++)
{
MailAddress to = new MailAddress(iMail.to);
MailAddress from = new MailAddress(iMail.from, iMail.displayName);
string body = iMail.body;
string subject = iMail.sub;
oMail = new MailMessage(from, to);
oMail.Subject = subject;
oMail.Body = body;
oMail.IsBodyHtml = true;
oMail.Priority = MailPriority.Normal;
oMail.Sender = from;
s = new SmtpClient(smtpServer);
if (s != null)
{
s.Send(oMail);
}
oMail.Dispose();
s = null;
}
này vòng gửi hơn 60.000 email. nhưng vấn đề của tôi tôi nhận được "thất bại gửi thư" trong một số email một số lần 5000 và một số thời gian ít hơn sau đó phần còn lại của họ được giao. và tôi đã kiểm tra tất cả các email lỗi đó có địa chỉ email hợp lệ. không biết vấn đề là gì. tôi thực sự cần giúp đỡ trong việc này.
Chỉnh sửa: Đây là ngoại lệ của tôi dấu vết
Error - Failure sending mail.; Inner Ex - System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed. at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
Tôi tin rằng điều này có thể giúp bất cứ ai có vấn đề tương tự. http://support.microsoft.com/kb/2183292/en-us – curiousBoy