TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anand MR
NA
39
19.9k
SMTP sever
Jul 22 2015 3:43 AM
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();
string[] toArray = {"
[email protected]
","
[email protected]
","
[email protected]
"};
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);
Reply
Answers (
8
)
how to custom scaffold in mvc5
how can inport excel's image into windows's datagridview