邮件标题中找到了无效字符;

时间:2013-12-16 09:50:22

标签: asp.net

在邮件标题中找到了无效字符:';'。

String s="arun@gamil.com,mohan@gmail.com";

MailMessage oMailMessage = new MailMessage();
oMailMessage.To.Add(new MailAddress(s));
oMailMessage.From = new MailAddress(oSmtpSection.From);

我在oMailMessage.To.Add(new MailAddress(s));

收到错误

1 个答案:

答案 0 :(得分:0)

以下是代码:

MailMessage oMailMessage = new MailMessage();
oMailMessage.Body = ....;
oMailMessage.To.Add("arun@gamil.com");
oMailMessage.To.Add("mohan@gmail.com");

SmtpClient smtp = new SmtpClient();
smtp.Send(oMailMessage);