Best Practices for Email Validation

Recommendations on How to Use Unique Operations in DOTS Email Validation to Get the Best Results

DOTS Email Validation (EV) has been updated with new features. In this document, we provide recommendations on how to use these new features to fully validate your email addresses beyond the level of validation available with other email validation systems. Example code is included to show our recommendations on how to use DOTS Email Validation's unique operations to get the best results. Although the overall performance of DOTS Email Validation has been increased to improve response times, it's the new detail and automation it offers that pushes the Web service beyond the scope of other email validators. We've added five new flags to the list of verification output results, including a unique quality score that provides at-a-glance verification of email address integrity. New Features:

  1. Email Quality Score: Indicates whether the email address is believed to be Good, Probably Good, Probably Bad, or Bad, determined by analyzing the available data. A good email address is one that passes the majority of our quality tests, from basic syntax checks to mail server-level tests that verify the existence of the mailbox. Probably Good means that while the address is good, it may be a catchall. It could also mean that there was not enough information available at time of testing and may require further testing. Probably bad means that the even though the email address passed SMTP-level checks, based on information derived by additional testing, the validity of the address is dubious, (ex. It uses a bogus name, random keystrokes or vulgar terms.) Finally, if an email address fails a critical test, then the email address is definitely bad.
  2. Deliverability Indicator: Uses the results of the DNS and SMTP level checks to determine deliverability.
  3. SMS Gateway Detection: Indicates if the email address is known to use an SMS-Gateway, which is intended to be used for text-only messages to cell-phones. (see Service Object's blog posting on pitfalls of sending emails via sms gateways).
  4. Role Address Detection: Identifies role-based addresses that may be used and managed by multiple people within an organization.
  5. Business Address Detection: Indicates if the address is believed to be tied to a business or used for business purposes.

A valid email address is not always a good email address. Many email validators do basic syntax checks or possibly SMTP checks and email directory lookups; but that's often not enough. Syntax checking only spots incorrectly formatted email addresses, and SMTP checks and email directory lookups do not always provide enough information to indicate whether or not an email address is really good. For instance, some valid email addresses may be disposable aliases or dedicated spam boxes that other validation services overlook. While the new version of DOTS Email Validation adds new flags that add even more detailed information to your returns, it's the scoring that saves developers' time and effort from having to analyze those returns: it provides an easy to use quality score that reveals whether an email is good, bad or requires further testing.

4-Step Guide: How to Thoroughly Validate an Email Address Using DOTS Email Validation

The following steps describe how to effectively validate an email address using DOTS Email Validation. This model can be applied to various types of applications, such as Web forms, CRM systems or live validation on spreadsheets used for data entry.

Step 1: Email Correction

The CorrectEmail operation verifies the integrity of email addresses and fixes any that may be malformed, correcting typos and misspellings of popular email provider domains, (such as gmail.com, yahoo.com, and hotmail.com). If no errors are found, then the output will be the same as the user input. This is a fast operation and is recommended to use as a preliminary check: It generally returns a result in about one tenth of a second. If you are using DOTS Email validation to validate a form in real-time, then we recommend running this operation immediately after users have finished entering their email address (fig 1.1).
Input/Output Example:

User Input: DOTS EV Output:
geoff.grow@yaaho.cm geoff.grow@yahoo.com
geoff.grow@hotmial.co geoff.grow@hotmail.com
geoff.grow@gmail geoff.grow@gmail.com
mailto:geoff.grow@gmail.com?Subject=Hi geoff.grow@gmail.com
Figure 1.1
[WebMethod(EnableSession=false, CacheDuration=0)]
public static string CorrectEmail(string email)
{
string result = "";
EV2_Primary.DOTSEmailValidation2 ev2 = new EV2_Primary.DOTSEmailValidation2();
EV2_Primary.EmailCorrectResult ecResult = ev2.CorrectEmail(email, LICENSE_KEY);

 if (ecResult != null && ecResult.EmailCorrectInfo != null)
{
 result = ecResult.EmailCorrectInfo.EmailAddressOut;
}

return result;
}
The CorrectEmail function makes the call to the web method CorrectEmail (figure 1.1), which gets the corrected email address to validate.
Figure 1.2 Javascript code
function CorrectEmail(email) {
        PageMethods.CorrectEmail(email, ceOnSucceeded, ceOnFailed);
   }

This method calls the CorrectEmail operation in the DOTS Email Validation service. The WebMethod attribute indicates that the method is exposed as part of a web service that can be accessed by the client-side javascript (shown in figure 1.2).

Note that the WebMethod attribute is only available after you have added a reference to System.Web.Services


Step 2: Validate the Email Address

The ValidateEmailFastNoNames_v2 operation quickly validates an email address in about two to three tenths of a second. It checks the address against an extensive, dynamic database that updates hourly; it also runs the address through our usual battery of tests to catch things like bogus names, random keystrokes or vulgar terms, for example. Example Output:

<EmailAddressIn>geoff.grow@gmail.com</EmailAddressIn>
<Box>geoff.grow</Box>
<Domain>gmail.com</Domain>
<IsRecognizedTLD>true</IsRecognizedTLD>
<TopLevelDomain>.com</TopLevelDomain>
<TopLevelDomainDescription>commercial</TopLevelDomainDescription>
<IsCCTLD>false</IsCCTLD>
<IsSyntaxGood>true</IsSyntaxGood>
<IsDomainSpecificSyntaxGood>true</IsDomainSpecificSyntaxGood>
<IsDNSGood>true</IsDNSGood>
<IsSMTPServerGood>true</IsSMTPServerGood>
<IsCatchAllDomain>false</IsCatchAllDomain>
<IsSMTPMailBoxGood>true</IsSMTPMailBoxGood>
<IsFree>true</IsFree>
<IsEstablished>false</IsEstablished>
<IsAlias>false</IsAlias>
<IsBogus>false</IsBogus>
<IsVulgar>false</IsVulgar>
<IsSMSDomain>false</IsSMSDomain>
<IsRole>false</IsRole>
<IsGood>0</IsGood>
<IsDeliverable>true</IsDeliverable>
<IsBusinessAddress>false</IsBusinessAddress>
Figure 2.1 Javascript code
function ValidateEmailFast (email) {
        PageMethods.ValidateEmailFast(email, veOnSucceeded, veOnFailed);
   }

The web method ValidateEmailFast is called by its corresponding javascript function.

Figure 2.2
[WebMethod(EnableSession = false, CacheDuration = 0)]
public static EV2_Primary.EmailValidateResult_v2 ValidateEmailFast(string email)
{
EV2_Primary.DOTSEmailValidation2 ev2 = new EV2_Primary.DOTSEmailValidation2();
EV2_Primary.EmailValidateResult_v2 result = ev2.ValidateEmailFastNoNames_v2(email, LICENSE_KEY);

return result;
}

Step 3: Examine the Results

The validation results are available in the veOnSucceeded function (figure 3.1). This is where we begin examining the quality of an email address. The first value to look for when examining the results is the IsGood property. This property returns an integer value between 0 and 4, with 0 indicating that there is a high probability that the address is good and 4 meaning that the address is bad. A score of 3 indicates that the address passes some tests, but that it is most likely bad. Email addresses that receive a score of 1 or 2 may require further testing and review, (covered in step 4); DOTS Email Validation provides detailed results that give you the ability to further filter the results according to your specific needs.

Here are some Examples of what to look for:

Aliases - If the address is found to be an alias then there is a high likelihood that it is being used as a disposable address or as a spam box. Established Addresses - If an address is found to be established in large emailing lists commonly used by solicitors and spammers, then there is a chance that the email address has been abandoned by its user due to it being overrun by constant spam. Role Addresses – These are not personal addresses and are generally managed by more than one person. Role-based addresses represent jobs, roles, or functions for groups that may not be able to agree to transactional or relationship messages. For this reason, mass email marketers that send out bulk email messages- such as newsletters - won't accept email lists that contain role addresses. SMS Addresses – Addresses that use SMS Gateways only accept plain text messages that are meant to be sent to mobile phones. (see article that describes pitfall in sending emails to SMS gateway addresses.)

Figure 3.1 Javascript code
 
function veOnSucceeded(result, userContext, methodName) {   

   if (result != null && result.EmailValidateInfo_v2 != null) {
     var email = result.EmailValidateInfo_v2.EmailAddressIn;
     var qualityScore = result.EmailValidateInfo_v2.IsGood; 

     if (qualityScore == 4 | qualityScore == 3) {
       // Bad Email Address.
       // Enter your custom code here ...
     }
     else {
       if (qualityScore == 1 | qualityScore == 2) {
         // Review the email address using the
// ValidateEmailFull_v2 operation when you submit the form.
       }
       if (qualityScore == 0) {
         // The email address is good and does not need to be
// reviewed with the ValidateEmailFull_v2 operation.
         doEmailValidateFull.value = 0;
       }

       // [OPTIONAL]          
// Examine the rest of the validation results to filter even further.
       if (result.EmailValidateInfo_v2.IsSMSDomain == true) {
         // The email uses an SMS Gateway.
         // Enter your custom code here ...
       }
       if (result.EmailValidateInfo_v2.IsEstablished == true) {
         // The email is known to be established on spamming lists.
         // Enter your custom code here ...
       }
       if (result.EmailValidateInfo_v2.IsRole == true) {
         // The email is a role address.
         // Enter your custom code here ...
       }
       if (result.EmailValidateInfo_v2.IsAlias == true) {
         // The email appears to be an alias.
         // Enter your custom code here ...
       }
       if (result.EmailValidateInfo_v2.IsVulgar == true) {
         // The email appears to contain vulgar words.
         // Enter your custom code here ...
       }
     }   

   }
 }

Step 4: Review an Email Address

It is recommended to use the ValidateEmailFull_v2 operation when the results in step three indicate that the email is "unknown" (quality score of 2) or "probably good" (quality score of 1). To review uncertain email addresses using the ValidateEmailFull_v2 operation, include a statement like the one in figure 4.1 in the method handling the submit button's OnClick event.

In some cases, the ValidateEmailFull_v2 operation may still return a value of "unknown" for email addresses in which communication with the hosting mail server could not be entirely resolved. Some modern mail servers employ defensive tactics that require more persistence than others. For email addresses in which you absolutely must have SMTP level information, DOTS Email Validation has background processes that will continue to try to verify an unknown address with its hosting mail server. In such cases, wait an hour or two and then run the ValidateEmailFast_v2 operation again. The background processes may have finished verifying the address with the defensive mail server by then. The ValidateEmailFull_v2 operation performs live validation and will run a full suite of tests and checks that take longer to complete. Completion times can range from half-a-second to ten seconds, depending on how much information is readily available, with most full validations averaging about four seconds per email.

Figure 4.1 Javascript code
  
// Check if the email address needs to be reviewed with ValidateEmailFull_v2
if (EmailValidateFullHF.Value == "1")
{
//Set up proxy to Service Objects primary server
EV2_Primary.DOTSEmailValidation2 primary = new EV2_Primary.DOTSEmailValidation2();
primary.Timeout = WEB_SERVICE_REQUEST_TIMEOUT;

return primary.ValidateEmailFull_v2(email, LICENSE_KEY);
}

The full sample code project can be downloaded here.


To test DOTS Email Validation against your own data, we provide two options: Download a Free Trial key and integrate our XML Web service into your application; or let Service Objects do a sample batch for you.