Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > E-mail Validation w/ PHP

E-mail Validation w/ PHP
Thread Tools
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status: Offline
Reply With Quote
May 24, 2006, 07:17 AM
 
It seems most e-mail address validation schemes (in forms) evaluate the validity of an e-mail address based on its characteristics as a string (e.g., whether it has only one @-sign, whether there's a domain and extension, etc.).

But what if there's a better and easier way by querying your SMTP server and asking it if the e-mail is legit? I know you can issue SMTP commands via the Terminal (helo, rcpt-to, etc.), so is it possible to do this on your web server via PHP?
     
Baninated
Join Date: Mar 2005
Location: An asteroid remanent of Tatooine.
Status: Offline
Reply With Quote
May 24, 2006, 09:16 AM
 
     
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status: Offline
Reply With Quote
May 24, 2006, 10:53 AM
 
Originally Posted by Obi Wan's Ghost
*Sigh* If you read my post, you will see that I'm not talking about conventional form validation via PHP, but a very different approach that uses queries to the SMTP server. These kinds of "use Google, you idiot" responses are not usually all that helpful. I only post these questions after I've tried using the search engines.

Those "first four" you refer to all use string-evaluation mechanisms, by the way. Maybe we should outlaw RTFM posts and "use Google, you moron" posts around here. Please forgive my obviously irritated tone, but I'm really sick of being condescended to. If that was not your intent, I apologize.
     
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
May 24, 2006, 11:07 AM
 
SMTP verification is possible, but not particularly reliable. You may get OKs for addresses that are just catch-alls, or you may get no "email is valid" response, e.g. from AOL servers.

If you absolutely want the email address to be valid, just email a confirmation link.
     
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status: Offline
Reply With Quote
May 24, 2006, 11:13 AM
 
Originally Posted by Mithras
SMTP verification is possible, but not particularly reliable. You may get OKs for addresses that are just catch-alls, or you may get no "email is valid" response, e.g. from AOL servers.
Sounds like SMTP behavior, for sure. Makes sense.
If you absolutely want the email address to be valid, just email a confirmation link.
That has its own set of problems. You need to record the entries in a database, you have to compare the return queries against that dbase, etc. I was hoping to avoid that. I guess there's a reason why so many folks use the string-based approach.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:49 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2