Click here to Skip to main content
15,888,108 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Frineds,

I Want to send mail with UserName whome i am sending mail having multiple recipients


suppose i am sending mail to abc@gmail.com; def@gmail.com , xyz@gmail.com.

i want abc@gmail.com get mail as,

Hi abc
---
---
mail body
----



def@gmail.com get mail as,

Hi def
---
---
mail body
----

xyz@gmail.com get mail as,

Hi xyz
---
---
mail body
----

Guys if u have some solution please share with me.
Posted
Comments
[no name] 18-Apr-14 10:22am    
And what have you tried? What is the problem with what you have tried?
Member 9988018 18-Apr-14 10:28am    
i have the code to send mail.
i just want to send mail with the recipient name.
Like Hi Wes
but i am sending mail to multiple user.
so different user should get mail with his name
[no name] 18-Apr-14 10:34am    
Okay so go ahead and do that. I am still not seeing any code for what you have written to accomplish this nor am I seeing a description of any kind of a problem. If you want to add some name to the message body then add the name to the message body.
Matt T Heffron 19-Apr-14 18:23pm    
You can't send a single email to multiple recipients and have them each get a different message body. If you want them to be personalized, you must send separate emails.

1 solution

VB
to send to multiple recipients, separate  recipient string with a comma as separator and later call the Send method.

string recipient = "foo@bar.com,foo2@bar.com,foo3@bar.com";
Then to add the recipients to the MailMessage object:

string[] emailTo = recipient.Split(',');
for (int i = 0; i < emailTo.GetLength(0); i++)
    mailMessageObject.To.Add(emailTo[i]);


Regards,
Praveen Nelge
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900