EmailAddressCollectionAdd Method (EmailAddressCollection)
Adds the list of the e-mail addresses specified as EmailAddressCollection to the current collection.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public void Add(
	EmailAddressCollection addresses
)

Parameters

addresses
Type: MailBee.MimeEmailAddressCollection
The EmailAddressCollection object containing the list of the e-mail addresses to be added.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionaddresses is a null reference (Nothing in Visual Basic).
Examples
This sample creates a new collection of the e-mail addresses and populates it with some addresses, loads the message from .EML file, and adds this collection to the message recipients collection.
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

EmailAddressCollection adrs = new EmailAddressCollection();
adrs.AddFromString("User1 <user1@domain.com>");
adrs.Add("user2@domain.com");

MailMessage msg = new MailMessage();
msg.To.Add(adrs);
foreach (EmailAddress adr in adrs)
{
    Console.WriteLine(adr.Email);
}
See Also