Solved

WebService that validates a list of email addresses

Posted on 2011-09-30
11
300 Views
Last Modified: 2013-11-19
Does anyone know of any webservices that I can call to validate if a list of email addresses are valid ones?

I'm looking for any companies that offer this kind of webservice.
0
Comment
Question by:Q-M
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 36896607
What programming languages do you use?  If you can use PHP, I can show you how you can do the validation yourself.  If you are determined to use a paid service I can write one for you in about 10 minutes and you can rent it from me ;-)

The email service provider www.ConstantContact.com (I use them and I am pleased to recommend them) can validate email addresses.
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 36897443
define valid.. is it valid syntax or is it a working email address (easiest way to check is to send an email and i.e. with the users password (website defined) and allow them to login
0
 

Author Comment

by:Q-M
ID: 36899872
Thanks guys, by valid I meant: is it a working email address.

The problem is that we have a page where one of our users enters in a list of email addresses in a textbox and we need to be able to check whether the email address is a working one before we save it in our system.

I've been testing out this service:

http://www.xwebservices.com/Web_Services/XWebEmailValidation/

But it runs a little slow for our liking and I'm wondering if there is any else out there that we could use.
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 36899967
what this program does is send a test email on your behalf and if it returns anything but an error message (non-deliverable)  it will say that email address exists.  Is it the users address? No way of telling unless the user either replies to the message or clicks on a link it will fail..   You can do this yourself if you can code an smtp client.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 36900640
You have several moving parts to an application like what you describe.  And there are many potential hiccups along the way.

Step one: validate the email address to the standards of the RFCs and determine that the domain is routable.  You can do that with the contents of the code snippet, if you're able to use PHP (you did not answer my earlier question about that).

Step two: send an email and get a human response.  This is generally referred to as a "handshake" and the article linked here shows you how to do it.  This is where it gets tricky.  The human may ignore the message (or it may get thrown into a spam folder).  The human's server may or may not bounce the message - there is no standard for this.  It is easy to track bounced messages, but the question I have about bouncing messages is, "Why bother?"  I get no value from bouncing messages, so I just ignore unroutable messages.  You will find that a lot of other people ignore unroutable messages, too.  The real key to success here will be the value proposition you create for the human on the receiving end of the message.  If the human perceives value and responds to the message you've got a live one.

The way to achieve a handshake is here.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_3939-Registration-and-Email-Confirmation-in-PHP.html

I don't know if you are planning on sending unsolicited messages in the USA, but you might want to consider the risk of criminal penalties.

Best of luck with your project, ~Ray
<?php // RAY_email_validation.php
error_reporting(E_ALL);



// A FUNCTION TO TEST FOR A VALID EMAIL ADDRESS, RETURN TRUE OR FALSE



// SEE MAN PAGE: http://php.net/manual/en/intro.filter.php
function check_valid_email($email)
{
    // IF PHP 5.2 OR ABOVE, WE CAN USE THE FILTER
    if (strnatcmp(phpversion(),'5.2') >= 0)
    {
        if(filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE) return FALSE;
    }

    // IF LOWER-LEVEL PHP, WE CAN CONSTRUCT A REGULAR EXPRESSION
    else
    {
        $regex
        = '/'                        // START REGEX DELIMITER
        . '^'                        // START STRING
        . '[A-Z0-9_-]'               // AN EMAIL - SOME CHARACTER(S)
        . '[A-Z0-9._-]*'             // AN EMAIL - SOME CHARACTER(S) PERMITS DOT
        . '@'                        // A SINGLE AT-SIGN
        . '([A-Z0-9][A-Z0-9-]*\.)+'  // A DOMAIN NAME PERMITS DOT, ENDS DOT
        . '[A-Z\.]'                  // A TOP-LEVEL DOMAIN PERMITS DOT
        . '{2,6}'                    // TLD LENGTH >= 2 AND =< 6
        . '$'                        // ENDOF STRING
        . '/'                        // ENDOF REGEX DELIMITER
        . 'i'                        // CASE INSENSITIVE
        ;
        // TEST THE STRING FORMAT
        if (!preg_match($regex, $email)) return FALSE;
    }

    // FILTER_VAR OR PREG_MATCH DOES NOT TEST IF THE DOMAIN IS ROUTABLE
    $domain = explode('@', $email);

    // MAN PAGE: http://php.net/manual/en/function.checkdnsrr.php
    if ( checkdnsrr($domain[1], "MX") || checkdnsrr($domain[1], "A") ) return TRUE;

    // EMAIL IS NOT ROUTABLE
    return FALSE;
}



// DEMONSTRATE THE FUNCTION IN ACTION
$e = NULL;
if (!empty($_GET["e"]))
{
    $e = $_GET["e"];
    if (check_valid_email($e))
    {
        echo "<br/>VALID: $e \n";
    }
    else
    {
        echo "<br/>BOGUS: $e \n";
    }
}


// END OF PROCESSING - CREATE THE FORM USING HEREDOC NOTATION
$form = <<<ENDFORM
<form>
TEST A STRING FOR A VALID EMAIL ADDRESS:
<input name="e" value="$e" />
<input type="submit" />
</form>
ENDFORM;

echo $form;

Open in new window

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Q-M
ID: 36903462
Hi there,

Sorry about that, I'm not able to use PHP as our site is developed in asp.net.

We do check the email address inputed with a regular expression to make sure that the email is in correct format.

0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 36903802
Whether you use asp.net or PHP or Java -- the design pattern, legal and email issues remain pretty much the same.
0
 
LVL 16

Accepted Solution

by:
Rose Babu earned 500 total points
ID: 36977998
Hi,

Have a look on the below link for email address verification web service.

http://www.strikeiron.com/Catalog/ProductDetail.aspx?pv=5.0.0&pn=Email+Verification
0
 

Author Comment

by:Q-M
ID: 36979565
Thanks, srosebabu
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 36980086
Have you actually tested the service offered by StrikeIron.com?  I am asking because (1) I am always suspicious of a service that requires you to register with your personal information before you can test, and (2) I expect it will generate false positives and possibly also false negatives, and (3) there really is no accountability in the email system.  I think it is wise to test the answers you get at EE before you accept.  The only reliable tests you can accomplish without sending the email and getting a reply are these:

1. the email address is well-formed
2. the email address has a routable domain.

Using these tests, the email address qwertyuiopasdfghjklzxcvbnm1234567890@gmail.com is a valid address.  
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 36983491
Considering that there is free code on codeplex that validates email and you can incorporate this into your website with a little work and save a lot of money, I wouldn't use the strikeiron service ever.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The task of choosing a web design company to build a website for your business should never be taken in a light manner. Provided the fact that your website will act as a representative to your business and will be responsible for imposing an online …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to dynamically set the form action using jQuery.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now