Click or drag to resize
Validating Email Address
Besides being able to locate MX Records, Email Validator has a powerful email validation engine to validate either Single email address or Millions of email addresses.

Before proceeding any further, we must state that Email Validator cannot be used for any spamming purposes, email address harvesting, or any other illegal purposes. This would violate the Email Validator license agreement.

Using the Validate() Method

The core validation method of Email Validator, is the MXValidate.Validate() method.

Email Validator validates email addresses at 4 different levels. These levels include:

ValidationLevels.Syntax

ValidationLevels.MXRecords

ValidationLevels.SMTP

ValidationLevels.Mailbox

Each of these levels will be discussed below.

ValidationLevels.Syntax

The syntax level is the easiest validation to perform. When an email is checked for ValidationLevels.Syntax, the email address is verified that it is syntactically correct.

ValidationLevels.MXRecords

Checks to see if an email address is both syntactically correct and makes a DNS call to verify the domain name part of an email address has MX Records.

ValidationLevels.SMTP

Checks all of the above levels, and verifies a successful connection to an email address's mail server.

ValidationLevels.Mailbox

Checks all of the above levels and verifies that a mailbox exists for the email address.

When Validate() is executed, it attempts to validate an email address UP TO the level that was specified. If the validation was successful, it returns true. If the validation was NOT successful, it returns false.

If only MXRecords was achieved, perhaps a network connection was down, and the email address could be flagged for later validation.

A Word about Email Validation

Email validation is a tricky process. Email Validator has made this process incredibly simple yet powerful. The only correct way to verify an email address existence is to send an email and see if you receive a bounce back email or NDR (Non-Deliverable Receipt). Email Validator goes as far as possible in attempting to validate email addresses without sending an actual email.

There are a couple of issues to be aware of, when validating email addresses at the ValidationLevels.Mailbox level.

Positive Validation when a Mailbox doesn't exist

Some mail servers always return a positive response that a mailbox exists, and it is only until an email is sent to a mailbox, that the server responds with a negative response saying a mailbox does not exist. Microsoft's exchange server is notorious for doing this. However, we have optimized Email Validator to help with this situation, and return faster results against those known servers.

ValidationLevels.Mailbox can be a Time Intensive Process

To better explain what happens under the covers when an email addresses is tested to Mailbox level, the following steps occur:

1. The email addresses is syntactically checked.

2. If the email address is valid, a DNS Lookup for MX Records is made. This involves network calls to DNS Servers to see if MX Records exist. If the binary MX Records exist, and are returned to Email Validator, Email Validator turns the records into a usable form.

3. If the MX Records return the names of the Mail Servers, and not the IP addresses of the mail servers, another DNS call is made to look up the actual IP addresses.

4. Once the IP addresses have been determined, another network call is made, this time to the email address's SMTP server. If the mail server is not responding, and there are fail over MX Records, Email Validator will resolve each of the additional MX Records to IP addresses and then attempt to make a successful SMTP connection.

5. Once a SMTP session has been established, standard SMTP command are issued against the mail sever to determine if a mailbox exists for the email address. To protect against email harvesting, some mail servers will always return a positive response, saying a mailbox exists, when in fact, it doesn't. Also, a DNS Server or SMTP server may be down at the very instance you are attempting to validate an email address. Thus Email Validator could accidentally mark that email address as not valid, when in fact it is. It's recommended that you test failed email addresses a couple of times, at different times, to verify they are in fact bad.

Email Validator has been highly optimized, however, most of the time-intensive issues that affect email validation are outside of the control of Email Validator. These include the across-the-internet or across-the-network DNS lookups, and the across-the-internet SMTP calls. Depending upon your network speed, and the remote SMTP server, the whole process may be completed in a few seconds; however, we've seen it take as long as 60 seconds. To help with this, Email Validator utilizes a number of built-in higher-performance techniques.
See Also