MailBee.NET Objects 4.0

EmailAddressCollection Constructor (String)

Initializes a new EmailAddressCollection instance from a string containing e-mail addresses.

public EmailAddressCollection(
   string emails
);

Parameters

emails
The string containing the list of the e-mail addresses delimited with comma (,) or semicolon (;). The e-mail addresses may include display names or remarks.

Example

This sample creates a new collection of the e-mail addresses and displays each address in this collection.

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

EmailAddressCollection adrs = new EmailAddressCollection("jdoe@domain1.com, some one <someone@domain2.com>, me@host.com (Comment)");
foreach (EmailAddress address in adrs)
{
    Console.WriteLine(address.Email);
}
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.Mime

Dim adrs As EmailAddressCollection = New EmailAddressCollection("jdoe@domain1.com, some one <someone@domain2.com>, me@host.com (Comment)")
For Each address As EmailAddress In adrs
    Console.WriteLine(address.Email)
Next

See Also

EmailAddressCollection Class | MailBee.Mime Namespace | EmailAddressCollection Constructor Overload List | AsString