EmailAddressCollectionAsString Property
Gets or sets all the e-mail addresses in the collection as a string.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public string AsString { get; set; }

Property Value

Type: String
A string containing all the full e-mail addresses in the collection (with display names and remarks if any).

Another way of adding e-mail addresses to the collection is using Add(EmailAddress) method.

The e-mail addresses will be delimited with comma (,). However, if the given collection belongs to the MailMessage object (for instance, represents To property), the delimiter in the output string will be either comma (,) or semicolon (;) depending on MailMessage.Builder.AddressDelimeter property value. Anyway, when parsing an e-mail address string rather than building it, both comma and semicolon are recognized as valid delimiters.

This sample creates a new collection of e-mail addresses and displays each address from this collection.
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

EmailAddressCollection adrs = new EmailAddressCollection(", some one <>, (Comment)");
adrs.AsString = @", ""User 2"" <>, (Domain Company, LLC)";
foreach (EmailAddress address in adrs)
See Also