MailBee.NET Objects 4.0

Smtp.Cc Property

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

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

Property Value

The EmailAddressCollection object representing CC: field (carbon recipients) of the message.

Remarks

This property is equivalent to Cc property of Message object.

Example

Setting CC: recipients using different methods.

[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.Cc.AsString = "Bill Smith <bsmith@company.com>, kathy@mail.com, \"John Long, Jr.\" <jl@domain.com>";
mailer.Cc.Add("email@address.com");
mailer.Cc.Add("John Doe, Sales Manager", "jdoe@domain.com");
mailer.Cc.Add(new EmailAddress("user@host.com"));

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

// The output.
"Bill Smith" <bsmith@company.com>, kathy@mail.com, "John Long, Jr." <jl@domain.com>, email@address.com, "John Doe, Sales Manager" <jdoe@domain.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.Cc.AsString = "Bill Smith <bsmith@company.com>, kathy@mail.com, ""John Long, Jr."" <jl@domain.com>"
mailer.Cc.Add("email@address.com")
mailer.Cc.Add("John Doe, Sales Manager", "jdoe@domain.com")
mailer.Cc.Add(New EmailAddress("user@host.com"))

Console.WriteLine(mailer.Cc.ToString())

' The output.
"Bill Smith" <bsmith@company.com>, kathy@mail.com, "John Long, Jr." <jl@domain.com>, email@address.com, "John Doe, Sales Manager" <jdoe@domain.com>, user@host.com

See Also

Smtp Class | MailBee.SmtpMail Namespace