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.4 build 677 for .NET 4.5
public static bool ValidateEmailAddressSyntax(
	string email


Type: SystemString
The e-mail address string.

Return Value

Type: Boolean
true if the syntax of the specified string is correct; otherwise, false.
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.
This example returns Correct syntax as _mike.o' address is complex but still has valid syntax.
using MailBee.SmtpMail;

if (Smtp.ValidateEmailAddressSyntax("_mike.o'"))
    Console.WriteLine("Correct syntax");
    Console.WriteLine("Wrong syntax");
See Also