How to send one email message to multiple recepients in ASP.Net

Last Reply on May 21, 2013 04:21 AM By Mudassar

Posted on May 21, 2013 04:18 AM

Sir,

I have used the mail mechanism as you have suggested earlier: 

http://aspsnippets.com/Articles/Send-SMTP-Emails-using-System.Net-Class-in-VB.Net.aspx

I have used this solution. And it's working fine for single id. But when i am using multiple id as reciepent mail id , it's mailing the text only to the first id. I am providing multiple id as below:

mm.To.Add(New MailAddress("k.sumeet@ymail.com,k.amit9906239675@gmail.com"))


here, if I place gmail id first and ymail id second, the would be send's only to gmail id not to ymail id, and same in case if I place ymail first and gmail second then mail send to ymail and not to gmail.

Why is it so?

Posted on May 21, 2013 04:21 AM

You will have to loop and add

  Dim emails As String = "raj@gmail.com,ram@gmail.com,ajay@gmail.com"
        For Each s As String In emails.split(",")
            mm.To.Add(s)
        Next