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);
8 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Raja TPosted Jul 22, 2015, 3:53 AM
Raja TPosted Jul 24, 2015, 4:00 AM
Anand MRPosted Jul 24, 2015, 3:47 AM
Raja TPosted Jul 22, 2015, 5:34 AM
Anand MRPosted Jul 22, 2015, 5:21 AM
Raja TPosted Jul 22, 2015, 5:06 AM
Anand MRPosted Jul 22, 2015, 4:35 AM
Raja TPosted Jul 22, 2015, 3:51 AM