Internet Address ListParse(String) Method
Parse the given text into a new InternetAddressList instance.
Definition
Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
The parsed InternetAddressList.
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public static InternetAddressList Parse(
string text
)Parameters
- text String
- The text.
Return Value
InternetAddressListThe parsed InternetAddressList.
Remarks
Parses a list of addresses from the specified text.
Example
C#
public static void AddRecipients (MimeMessage message, string recipients)
{
// InternetAddressList.Parse() can parse a comma-separated list of addresses such as
// what a user might type into the "To:" field of a mail client.
var addresses = InternetAddressList.Parse (recipients);
message.To.AddRange (addresses);
}
Exceptions
| ArgumentNullException | text is . |
| ParseException | text could not be parsed. |