MailBee.NET Objects 4.0

EmailAddressCollection.Parse Method 

Creates a new EmailAddressCollection instance from the specified string containing the list of e-mail addresses.

public static EmailAddressCollection Parse(
   string addressString
);

Parameters

addressString
The string specifying the list of the e-mail addresses delimited with comma (,) or semicolon (;).

Return Value

EmailAddressCollection object representing addressString addresses.

Example

This sample creates a new collection of full e-mail addresses and displays each actual e-mail address.

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

EmailAddressCollection adrs =
    EmailAddressCollection.Parse(@"User1 <user1@domain.com>, user2@domain.com");
foreach (EmailAddress adr in adrs)
{
    Console.WriteLine(adr.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 = _
    EmailAddressCollection.Parse("User1 <user1@domain.com>, user2@domain.com")
For Each adr As EmailAddress In adrs
    Console.WriteLine(adr.Email)
Next

See Also

EmailAddressCollection Class | MailBee.Mime Namespace | EmailAddressCollection