且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用用户名发送邮件我发送邮件有多个收件人

更新时间:2023-12-03 09:02:46

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