SmtpValidateEmailAddressSyntax Method
Verifies if the specified string is a correctly formatted e-mail address.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public static bool ValidateEmailAddressSyntax(
	string email
)

Parameters

email
Type: SystemString
The e-mail address string.

Return Value

Type: Boolean
true if the syntax of the specified string is correct; otherwise, false.
Remarks
This method only checks the syntax of the e-mail address. It does NOT make any network connections and thus does NOT actually check if this address exists and you can send e-mails there. If you need further checks, you can use TestSend(SendFailureThreshold) method. To test bulk of e-mail addresses, consider using EmailAddressValidator component.
Note Note
As this method is static, you do not need to create an instance of Smtp object in order to use it.
Examples
This example returns Correct syntax as _mike.o'neil_loves_underscores@sub-domain.travel address is complex but still has valid syntax.
using MailBee.SmtpMail;

if (Smtp.ValidateEmailAddressSyntax("_mike.o'neil_loves_underscores@sub-domain.travel"))
{
    Console.WriteLine("Correct syntax");
}
else
{
    Console.WriteLine("Wrong syntax");
}
See Also