EmailAddressCollectionAdd Method (String, String) |
Adds the e-mail address (specified as actual e-mail address and display name parts) to the collection.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public void Add(
string email,
string name
)
Public Sub Add (
email As String,
name As String
)
Parameters
- email
- Type: SystemString
The actual e-mail address (such as JohnDoe@domain.com). - name
- Type: SystemString
The name which is displayed with the actual e-mail address (such as John Doe).
If a null reference (Nothing in Visual Basic), no display name will be assigned to the e-mail address.
Exceptions Examples This sample creates a new message and adds a recipient to this message.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.To.Add("jdoe@domain.com", "John Doe");
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.To.Add("jdoe@domain.com", "John Doe")
See Also