public void send() { try { LoademailID(); MailMessage message = new MailMessage(); message.To.Add(emailID.TrimEnd(',')); // emailID is string type variable holding 110 email records from DB message.Subject = "Testing Email Send"; message.From = new System.Net.Mail.MailAddress("emailID"); message.Body = "TextMessage"; System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.EnableSsl = true; smtp.Credentials = new System.Net.NetworkCredential("UserName", "Password"); smtp.Send(message); Label1.Visible = true; Label1.Text = "Mail Send Successfully"; } catch (SmtpFailedRecipientsException ex) { Label1.Visible = true; Label1.Text = ex.FailedRecipient; } }
Quote:The easiest way to prevent this message from popping up is to create distribution lists with a reasonable amount of e-mail addresses,less than 25 recipients if possible, although your server may allow between 50 - 75 recipients on each list. You can find out the limits for sending e-mails by contacting the mail administrator or your ISP. By saving a number of distribution lists with less than this number of contacts, you should avoid receiving this error message the next time you send mass emails.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)