我必须用多个抄送地址发送邮件。目前此代码仅适用于一个。这是代码:
MailAddress addressTo = new MailAddress("ma@.asd.a");
MailAddress addressFrom = new MailAddress("ma@.asd.a");
MailMessage MyMessage = new MailMessage("ma@.asd.a", "ma@.asd.a");
MyMessage.Subject = "New requests";
MyMessage.Body = @"Body";
MailAddress copy = new MailAddress("ma@.asd.a");
MyMessage.CC.Add(copy);
SmtpClient client = new SmtpClient();
client.Port = 32;
client.EnableSsl = false;
client.Host = "my-smtp";
client.Timeout = 10000;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Credentials = new System.Net.NetworkCredential(LocalUserName, "");
client.UseDefaultCredentials = false;
client.Send(MyMessage);
我已经绑了这个:
MailAddress copy2 = new MailAddress("maas@.asd.a");
MyMessage.CC.Add(copy2)
但它不起作用请求有超时错误。
有人可以帮我弄这个吗 ?
慕森王
相关分类