MailBee.NET Objects 3.1

Smtp.Bcc Property

Gets or sets EmailAddressCollection object specifying BCC: recipients of the message.

public MailBee.Mime.EmailAddressCollection Bcc {get; set;}

Property Value

The EmailAddressCollection object representing BCC: field (blind-carbon recipients) of the message.

Remarks

This property is equivalent to Bcc property of Message object.

Note   By default, BCC header is not included into the message being sent. BCC recipients still receive the message, but other recipients have no way of knowing this. If required, the developer can suppress removing BCC header on mail send operation by setting Mime.MailMessage.Builder.RemoveBccOnSend property to false.

Example

Setting BCC: recipients using different methods. Since BCC recipients do not appear in the message header, it makes no sense to include recipients display names into BCC (unless RemoveBccOnSend is false). If display name is included in BCC e-mail address, it's just ignored.

[C#]
// To use the code below, import these namespaces at the top of your code.
using System;
using MailBee;
using MailBee.SmtpMail;
using MailBee.Mime;

// The actual code (put it into a method of your class).

Smtp mailer = new Smtp();

mailer.Bcc.AsString = "<bsmith@company.com>, kathy@mail.com";
mailer.Bcc.Add("email@address.com");
mailer.Bcc.Add(new EmailAddress("user@host.com"));

Console.WriteLine(mailer.Bcc.ToString());

// The output.
<bsmith@company.com>, kathy@mail.com, email@address.com, user@host.com
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.SmtpMail
Imports MailBee.Mime

' The actual code (put it into a method of your class).

Dim mailer As New Smtp

mailer.Bcc.AsString = "<bsmith@company.com>, kathy@mail.com"
mailer.Bcc.Add("email@address.com")
mailer.Bcc.Add(New EmailAddress("user@host.com"))

Console.WriteLine(mailer.Bcc.ToString())

' The output.
<bsmith@company.com>, kathy@mail.com, email@address.com, user@host.com

See Also

Smtp Class | MailBee.SmtpMail Namespace