• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

WebService that validates a list of email addresses

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
Q-M
Asked:
Q-M
  • 4
  • 3
  • 3
  • +1
1 Solution
 
Ray PaseurCommented:
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
 
David Johnson, CD, MVPOwnerCommented:
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
 
Q-MAuthor Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
David Johnson, CD, MVPOwnerCommented:
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
 
Ray PaseurCommented:
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
 
Q-MAuthor Commented:
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
 
Ray PaseurCommented:
Whether you use asp.net or PHP or Java -- the design pattern, legal and email issues remain pretty much the same.
0
 
Rose BabuSenior Team ManagerCommented:
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
 
Q-MAuthor Commented:
Thanks, srosebabu
0
 
Ray PaseurCommented:
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
 
David Johnson, CD, MVPOwnerCommented:
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now