Gets or sets EmailAddressCollection object specifying To: recipients of the message.
The EmailAddressCollection object representing To: field of the message.
This property is equivalent to To property of Message object.
Setting To: recipients using different methods.
[C#] // To use the code below, import MailBee namespaces at the top of your code. using System; using MailBee; using MailBee.SmtpMail; using MailBee.Mime; // The actual code (put it into a method of your class). Smtp mailer = new Smtp(); mailer.To.Add("email@address.com"); mailer.To.Add("John Doe, Sales Manager", "jdoe@domain.com"); mailer.To.Add(new EmailAddress("user@host.com")); mailer.To.AsString += "Bill Smith <bsmith@company.com>, kathy@mail.com, \"John Long, Jr.\" <jl@domain.com>"; Console.WriteLine(mailer.To.ToString()); // The output. email@address.com, "John Doe, Sales Manager" <jdoe@domain.com>, user@host.com, "Bill Smith" <bsmith@company.com>, kathy@mail.com, "John Long, Jr." <jl@domain.com>
[Visual Basic] ' To use the code below, import MailBee namespaces at the top of your code. Imports MailBee Imports MailBee.SmtpMail Imports MailBee.Mime ' The actual code (put it into a method of your class). Dim mailer As New Smtp mailer.To.Add("email@address.com") mailer.To.Add("John Doe, Sales Manager", "jdoe@domain.com") mailer.To.Add(New EmailAddress("user@host.com")) mailer.To.AsString += "Bill Smith <bsmith@company.com>, kathy@mail.com, ""John Long, Jr."" <jl@domain.com>" Console.WriteLine(mailer.To.ToString()) ' The output. email@address.com, "John Doe, Sales Manager" <jdoe@domain.com>, user@host.com, "Bill Smith" <bsmith@company.com>, kathy@mail.com, "John Long, Jr." <jl@domain.com>
Smtp Class | MailBee.SmtpMail Namespace