Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h3>Email validation is not as simple as a regular expression</h3> <p>First, I would read this article <a href="http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx" rel="nofollow noreferrer">I Knew How To Validate An Email Address Until I Read The RFC</a>.</p> <p>Back in the days of yore, you could just connect to the user's mail server and use the VRFY command and verify that an email address was valid, but spammers abused that privilege and we all lost out.</p> <p>Now, I would recommend a three part approach:</p> <ol> <li><p>Verify the syntactic validity. You can use the monster regex from the <a href="http://ex-parrot.com/~pdw/Mail-RFC822-Address.html" rel="nofollow noreferrer">Mail perl module</a> to check to make sure that the email address is well formed. Then make sure to blacklist localhost domains/ips as part of your check.</p></li> <li><p>Verify that the domain is live. Do a DNS validation check on the domain. You could take this one step further and use a STMP check and make sure that you can connect to a valid mailserver for the domain. However, there may be some false negative results due to virtual hosting schemes.</p></li> <li><p>Send an actual email, but include a single image that links to a script on your server. When the email is read with the image, your server will be notified that the image was download and hence the email is alive and valid. However, nowadays many email clients do not load images by default for this very reason, so it won't be 100% effective.</p></li> </ol> <h3>Resources</h3> <ol> <li><a href="http://www.coveryourasp.com/ValidateEmail.asp" rel="nofollow noreferrer">Validating Email Addresses in ASP</a> (online)</li> <li><a href="http://www.joemarini.com/tutorials/tutorialpages/emaildomainexists.php" rel="nofollow noreferrer">Validating Email Addresses in PHP</a> (code examples)</li> <li><a href="http://www.spadixbd.com/bulkverifier/index.htm" rel="nofollow noreferrer">This commercial product does bulk email verification</a> ← This is probably what you are looking for</li> <li>SO Question: <a href="https://stackoverflow.com/questions/565504/how-to-check-if-an-email-address-exists-without-sending-an-email">How to check if an email address exists without sending an-email</a></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload