MailBee.NET Objects 7.2

MailMessage.Bcc Property

Gets or sets the list of blind carbon copy (BCC) recipients of the message.

public EmailAddressCollection Bcc {get; set;}

Property Value

An EmailAddressCollection object containing a collection of e-mail addresses of blind carbon copy recipients of the message. The default value is an empty collection.

Remarks

To specify it as a string, set msg.Bcc.AsString value (assuming msg is MailMessage instance). Thus you can construct a list of BCC recipients as a string delimited with comma or semicolon.

Although the message is sent to all recipients which are set in Bcc property, BCC field will not be included in the message header unless MailMessage.Builder.RemoveBccOnSend property is set to false.

Exceptions

Exception TypeCondition
MailBeeInvalidArgumentExceptionvalue is a null reference (Nothing in Visual Basic).

Example

This sample loads the message from .EML file and displays the e-mail addresses of BCC recipients.

[C#]
using System;
using MailBee.Mime;
using MailBee.Pop3Mail;

class Sample
{
    static void Main(string[] args)
    {
        // Quickly download the first message from the specified POP3 account
        MailMessage msg = Pop3.QuickDownloadMessage("pop3.mail.com", "dan_brown", "password", 1);

        Console.WriteLine("The list of BCC recipients of the message:");

        // For each BCC recipient...
        foreach (EmailAddress adr in msg.Bcc)
        {
            // ...show its e-mail address.
            Console.WriteLine(adr.Email);
        }
    }
}
[Visual Basic]
Imports System
Imports MailBee.Mime
Imports MailBee.Pop3Mail

Module Sample
    Sub Main(ByVal args As String())
        ' Quickly download the first message from the specified POP3 account
        Dim msg As MailMessage = Pop3.QuickDownloadMessage("pop3.mail.com", "dan_brown", "password", 1)

        Console.WriteLine("The list of BCC recipients of the message:")

        ' For each BCC recipient...
        For Each adr As EmailAddress In msg.Bcc
            ' ...show its e-mail address.
            Console.WriteLine(adr.Email)
        Next
    End Sub
End Module

See Also

MailMessage Class | MailBee.Mime Namespace | QuickDownloadMessage | Cc