Hi friends,
Here is my code for sending mail to Multiple users at a time.Its working fine.
But for example in multiple user's email id's any one is invalid ,in this case mail is not send to the rest of the valid email also.
My expectation is mail should send if there is valid email id's in the To address even any one of the email id is invalid.
Please give me the solution for this as soon as possible friends.
SmtpClient client = new SmtpClient(); //SMTP Client to Configure & Send email
client.Host = "";
client.Port = "";
client.Credentials = new System.Net.NetworkCredential("", "");
client.EnableSsl = false;
email.Subject = dsInitialdata.Tables[1].Rows[0]["EMAIL_SNT_MSG_SUBJ_TXT"].ToString();
if (toArray != null && toArray.Length > 0)
{
foreach (string toId in toArray)
{
if (toId.Trim() != String.Empty)
{
email.To.Add(toId);
}
}
}
email.IsBodyHtml = true;
MailAddress from = new MailAddress("[email protected]","Welcome");
client.Send(email);
Raja TRank #685 · 3.5K reputationPosted Jul 21, 2015, 11:53 PM EDT
Raja TRank #685 · 3.5K reputationPosted Jul 21, 2015, 11:51 PM EDT
Anand MR59 reputationPosted Jul 22, 2015, 12:35 AM EDT
Raja TRank #685 · 3.5K reputationPosted Jul 22, 2015, 1:06 AM EDT
Anand MR59 reputationPosted Jul 22, 2015, 1:21 AM EDT
Raja TRank #685 · 3.5K reputationPosted Jul 22, 2015, 1:34 AM EDT
Anand MR59 reputationPosted Jul 23, 2015, 11:47 PM EDT
Raja TRank #685 · 3.5K reputationPosted Jul 24, 2015, 12:00 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts