使用.NET SmtpClient将Bcc添加到电子邮件发送?

时间:2010-03-19 01:36:06

标签: c# .net email smtpclient

使用ASP.NET C#中的SMTPClient类发送电子邮件时,如何将bcc添加到电子邮件中?如何将bcc添加到MailMessage实例?

3 个答案:

答案 0 :(得分:45)

MailAddress addressTo = new MailAddress("to@someone.com");
MailAddress addressFrom = new MailAddress("from@someone.com");
MailAddress addressBCC = new MailAddress("bcc@someone.com");

MailMessage MyMessage = new MailMessage(addressFrom, addressTo );
MyMessage.Bcc.Add(addressBCC);

答案 1 :(得分:12)

您正在寻找名称恰当的Bcc property

message.Bcc.Add("You@Example.com");

答案 2 :(得分:0)

在这里,我将解释如何使用asp.net c#application 使用cc和bcc发送电子邮件

 MailMessage mailMessage = new MailMessage(smtpUser, toAddress);
 if (!string.IsNullOrEmpty(cc))
 {
    mailMessage.CC.Add(cc);
 }
 if (!string.IsNullOrEmpty(bcc))
 {
    mailMessage.Bcc.Add(bcc);
 }

完整示例http://www.stepover-f10.com/2014/01/how-send-email-with-cc-and-bcc-with-authentication-using-aspnet-csharp-example-source-code.aspx 点击此链接。