EmailAddressCollectionAddFromString Method |
Namespace: MailBee.Mime
Exception | Condition |
---|---|
MailBeeInvalidArgumentException | addressString is a null reference (Nothing in Visual Basic). |
For instance, if the string is "John Doe" <j.doe@domain.com> (ABC Company), a single EmailAddress object will be appended to the collection and its DisplayName property will be set to John Doe, Remarks property will be set to ABC Company, and the Email property will be set to j.doe@domain.com value.
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Mime; // Create a new MailMessage object. MailMessage msg = new MailMessage(); // Add the mail address to the collection. msg.To.AddFromString("John Doe <jdoe@domain.com> (ABC Company)");