如何使用用户名发送邮件我发送邮件有多个收件人 [英] How To Send Mail With Username Whome I Am Sending Mail Having Multiple Recipients
问题描述
Hi Frineds,
我想用UserName发送邮件,我发送的邮件有多个收件人
假设我发送邮件到abc@gmail.com; def@gmail.com,xyz @ gmail.com。
i想要abc@gmail.com收到邮件,
您好abc
---
---
邮件正文
----
def@gmail.com收到邮件,
你好def
---
---
邮件正文
- ---
xyz@gmail.com收到邮件,
你好xyz
---
---
邮件正文
----
如果你有一些解决方案,请与我分享。
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.
推荐答案
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]);
问候,
Praveen Nelge
Regards,
Praveen Nelge
这篇关于如何使用用户名发送邮件我发送邮件有多个收件人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!