EmailAddressGetAccountNameFromEmail Method
Gets the account name of the specified e-mail address as a string.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public static string GetAccountNameFromEmail(
	string email
)

Parameters

email
Type: SystemString
The e-mail address as a string.

Return Value

Type: String
A string containing the account name of the specified e-mail address.
Remarks

For instance, the account value will be returned for the account@domain.com e-mail address. To get the domain part, the developer should use the GetDomainFromEmail(String) method.

To get account name part or domain part of the existing EmailAddress object, the developer can use GetAccountName or GetDomain methods.

Examples
This sample extracts the account and domain names from the specified e-mail address.
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

Console.WriteLine(EmailAddress.GetAccountNameFromEmail("user1@domain.com"));
Console.WriteLine(EmailAddress.GetDomainFromEmail("user1@domain.com"));
See Also