我有一串EMAIL地址"[email protected];[email protected];[email protected]"MailMessage message = new MailMessage("[email protected]", "[email protected];[email protected];[email protected]", "test subject", "test body");
使用一个收人时能正常发送
使用多个收件人时有异常The specified string is not in the form required for an e-mail address.
请问使用MailMessage如何给多个人发信
使用一个收人时能正常发送
使用多个收件人时有异常The specified string is not in the form required for an e-mail address.
请问使用MailMessage如何给多个人发信
解决方案 »
- Remoting Server在向Client提供对象的时候能否自己也改变对象的状态?
- toolStripSplitButton 问题
- 【求助】C# 对话框如何自己添加控件?或者改写系统自带的控件?
- 使用DATESET的UPDATE使用事务出现问题
- 导出到Excel问题
- datagridview显示日期字段是出错的问题
- 关于数组的动态申请和改变大小的问题
- 问下C#如何打印网页上指定的图片
- 请问如何在程序里对sql语句实现绑定变量,来减少对oracle数据库的解析?
- 如何访问已经删除的记录?
- 存储过程的优势,静态方法,静态类,静态属性的优势???
- datagridview 使用虚拟模式后,如何实现点击列标题的排序功能
yourMailMessage.To.Add(new MailAddress("--1--:));
yourMailMessage.To.Add(new MailAddress("--2--:));
yourMailMessage.To.Add(new MailAddress("--3--:));
这种方式来设置多个收件人
{
MailAddress from = new MailAddress("[email protected]", "Ben Miller");
MailAddress to = new MailAddress("[email protected]", "Jane Clayton");
MailMessage message = new MailMessage(from, to);
// message.Subject = "Using the SmtpClient class.";
message.Subject = "Using the SmtpClient class.";
message.Body = @"Using this feature, you can send an e-mail message from an application very easily.";
// Add a carbon copy recipient.
MailAddress copy = new MailAddress("[email protected]");
message.CC.Add(copy);
SmtpClient client = new SmtpClient(server);
// Include credentials if the server requires them.
client.Credentials = CredentialCache.DefaultNetworkCredentials;
Console.WriteLine("Sending an e-mail message to {0} by using the SMTP host {1}.",
to.Address, client.Host);
client.Send(message);
}
MailAddress copy = new MailAddress("[email protected]");
message.CC.Add(copy);
楼上的,LZ要群发都是TO的,不是CC,请注意.