Question

When sending email using the SMTPClient class in ASP.NET C#, how can I add bcc to the email? How can I add bcc to a MailMessage instance?

Was it helpful?

Solution

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);

OTHER TIPS

You're looking for the aptly-named Bcc property:

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

Here i will explain how to send email with cc and bcc using asp.net c# application.

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

For full example http://www.stepover-f10.com/2014/01/how-send-email-with-cc-and-bcc-with-authentication-using-aspnet-csharp-example-source-code.aspx click this link.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top