MailBee.NET Objects 3.1

MailMessage.To Property

Gets or sets the e-mail addresses of the primary recipients of the mail message.

public EmailAddressCollection To {get; set;}

Property Value

A reference to the collection of the e-mail addresses of the primary recipients of the mail message. The default value is an empty collection.

Remarks

To specify this property as a string, set msg.To.AsString value (assuming msg is MailMessage instance).

To send a message, you should specify at least one recipient's e-mail address in To, Cc, or Bcc property. It's possible, however, to send a mail message even if no recipients specified in the message itself using Smtp.Send method.

Exceptions

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

Example

The example is available in MailMessage topic.

See Also

MailMessage Class | MailBee.Mime Namespace