Shyju
Shyju

Reputation: 218732

Adding Bcc to Email sending using .NET SmtpClient?

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?

Upvotes: 24

Views: 54771

Answers (3)

user3174290
user3174290

Reputation: 31

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.

Upvotes: 3

Kelsey
Kelsey

Reputation: 47726

MailAddress addressTo = new MailAddress("[email protected]");
MailAddress addressFrom = new MailAddress("[email protected]");
MailAddress addressBCC = new MailAddress("[email protected]");

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

Upvotes: 62

SLaks
SLaks

Reputation: 887449

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

message.Bcc.Add("[email protected]");

Upvotes: 14

Related Questions