MailBee.NET Objects 7.2

EmailAddress Constructor (String, String, String)

Initializes a new instance of the EmailAddress object from the specified e-mail address parts.

public EmailAddress(
   string email,
   string displayName,
   string remarks
);

Parameters

email
The actual e-mail address (such as johndoe@domain.com).
displayName
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.
remarks
The remarks which are displayed with the actual e-mail address (such as ABC Company). If a null reference (Nothing in Visual Basic), no remarks will be assigned to the e-mail address.

Exceptions

Exception Type Condition
MailBeeInvalidArgumentException email is a null reference (Nothing in Visual Basic).

Example

This sample creates a new instance of the EmailAddress object.

[C#]
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

EmailAddress adr = new EmailAddress("john_doe@domain.com", "John Doe", "ABC Company");
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.Mime

Dim adr As New EmailAddress("john_doe@domain.com", "John Doe", "ABC Company")

See Also

EmailAddress Class | MailBee.Mime Namespace | EmailAddress Constructor Overload List | EmailAddressCollection | MailMessage