 |
 |
E-mail Validation w/ PHP
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status:
Offline
|
|
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
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status:
Offline
|
|
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
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|