Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 237
Shyju Avatar asked Mar 19 '10 01:03

Shyju


People also ask

Is SmtpClient obsolete?

The SmtpClient class is obsolete in Xamarin. However: It is included in the . NET Standard 2.0 and later versions and therefore must be part of any .

How do you include a CC in an email?

To add a CC recipient, click on the downward arrow on the top right corner in the To address box, as shown below. This will display the CC and BCC fields. In the CC field, enter the mail addresses of the recipients who'll receive a copy of the email. Compose your message and hit Send.

How send email to multiple recipients in MVC?

Provide the project a name, such as "SendingEmailsToMultipleRecipients" or another as you wish and specify the location. Then right-click on Solution Explorer and select "Add New Item" - "Default. aspx" page and one class file. Drag and drop three Text Boxes and two buttons.

What is the difference between CC and BCC?

Bcc stands for blind carbon copy which is similar to that of Cc except that the Email address of the recipients specified in this field do not appear in the received message header and the recipients in the To or Cc fields will not know that a copy sent to these address.


1 Answers

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);
like image 170
Kelsey Avatar answered Oct 18 '22 09:10

Kelsey