MailBee.NET Objects 7.1

EmailAddress.ToString Method 

Returns the e-mail address as a string.

public override string ToString();

Return Value

A string containing the full e-mail address (including display name and remarks if any).

Remarks

The return value of this method is equivalent to the AsString property value. However, with AsString property, the developer can both get and set the e-mail address.

Example

This sample creates the new instance of the EmailAddress object and converts it into a string.

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

EmailAddress adr = new EmailAddress();

// Set the display name.
adr.DisplayName = "John Doe";

// Set the e-mail address.
adr.Email = "jdoe@domain.com";

// Set the remarks.
adr.Remarks = "ABC Company";

// Show full e-mail address.
Console.WriteLine(adr.ToString());
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.Mime

' Create new EmailAddress object.
Dim adr As New EmailAddress

' Set the display name.
adr.DisplayName = "John Doe"

' Set the e-mail address.
adr.Email = "jdoe@domain.com"

' Set the remarks.
adr.Remarks = "ABC Company"

' Show full e-mail address.
Console.WriteLine(adr.ToString())

See Also

EmailAddress Class | MailBee.Mime Namespace | AsString | Email | DisplayName