Home > Uncategorized > Split each email address seperated by semi colon

Split each email address seperated by semi colon

MailMessage mm = new MailMessage();
string strEmails = “abcccs22@domain.com; sd22321@gasd3mail.com; s2s33@gdasdsdmail.com;”;

string[] emails = strEmails.Split(‘;’);
foreach (string email in emails)
{
if (email.Trim() != string.Empty)
{
mm.ReplyToList.Add(new MailAddress(email));
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Trackbacks:0

Listed below are links to weblogs that reference
Split each email address seperated by semi colon from extremeweblog.com
TOP