|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
SitePoint Articles
Join Date: Apr 2001
Posts: 0
|
Article Discussion
This is an article discussion thread for discussing the SitePoint article, "Verify a User's Email Address Using PHP"
|
|
|
|
|
|
#2 |
|
SitePoint Enthusiast
![]() Join Date: Sep 2002
Location: Strongsville, OH
Posts: 99
|
so sad that windows doesnt support anything good though id assume that the people who would use this would not likely be on windows only possibly for testing or if their project is deployed. although i must admit i do find this nslookup for nix machines interesting maybe a follow up article doing more with it?
|
|
|
|
|
|
#3 | |
|
o_O O_o
![]() ![]() ![]() ![]() Join Date: Mar 2003
Location: Sioux Falls, SD
Posts: 480
|
Hmm. Interesting comments in the checkdnsrr() php manual page... Including this one:
Quote:
|
|
|
|
|
|
|
#4 |
|
.50 cal to the head
![]() ![]() ![]() ![]() ![]() Join Date: May 2004
Location: Australia
Posts: 864
|
I wish the user name could be checked too but then the mail servers enforce restrictions that won't allow you to run the user verification commands on them
. Its probably an anti-spam policy.Wish this article had been written earlier, i wouldn't have had to scratch my head finding an easy non-user-reply-dependent way to verify email addresses. |
|
|
|
|
|
#5 |
|
<? james('rules'); ?>
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2004
Location: Wales, UK
Posts: 792
|
I don't like it.
Check: http://ubertr0tt.com/checkdnform.html I think the code can be improved upon greatly, by check it contains an '@' before splitting, etc. The following didnt get picked up by the code: - @msn.com, @hotmail.com, etc on thier own. I know the code doesnt check for a username but still.. - iam@smelly.com - sitepoint@rules.com - coca@cola.com The list goes on ![]() Regards, 1337 ![]() |
|
|
|
|
|
#6 |
|
<? james('rules'); ?>
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2004
Location: Wales, UK
Posts: 792
|
[color=#f1f1f1]
Function: PHP Code:
PHP Code:
Regards, 1337 ![]() |
|
|
|
|
|
#7 | |
|
does not play well with others
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2003
Location: Munich, Germany
Posts: 1,370
|
Quote:
|
|
|
|
|
|
|
#8 | |
|
Keep it simple, stupid!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Posts: 1,897
|
Quote:
That code is useless. First the REGEX will illiminate lots of legal email addresses. For example 6 figure TLDs are becoming quite common. Also a space and various other characters are legal. Also you are using getmxrr(). This only checks for an MX record but an MX record is not required for sending email. Reading from the manual 'Note: This function should not be used for the purposes of address verification. Only the mailexchangers found in DNS are returned, however, according to RFC 2821 when no mail exchangers are listed, hostname itself should be used as the only mail exchanger with a priority of 0'. I run a domain for a couple of years with no MX records and only added them because I found people were using this errornous form of email validation. |
|
|
|
|
|
|
#9 |
|
SitePoint Member
Join Date: Sep 2005
Posts: 1
|
Can you make such script were I can upload a list of e-mailadresses?
|
|
|
|
|
|
#10 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2004
Location: Belgium
Posts: 919
|
The foolproof way is to send a mail to that address?! I you don't get an error-report, the address exists...
|
|
|
|
|
|
#11 |
|
does not play well with others
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2003
Location: Munich, Germany
Posts: 1,370
|
sure and the user gets an email saying: "That's just checking the valadity of your address.
You can ignore this mail and you will get another one." ![]() |
|
|
|
|
|
#12 | |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2004
Location: West Midlands, United Kingdom
Posts: 2,771
|
Quote:
|
|
|
|
|
|
|
#13 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2004
Location: Belgium
Posts: 919
|
If you're asking an email and you're planning to never use it, why would you ask for an email in the first place?
And it would be more something like: "We like to thank you for registering" and even give them a password or something, which gives them the right to exclusive content... |
|
|
|
|
|
#14 | |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2004
Location: West Midlands, United Kingdom
Posts: 2,771
|
Quote:
|
|
|
|
|
|
|
#15 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2004
Location: Belgium
Posts: 919
|
So why do they need an email-address then?
|
|
|
|
|
|
#16 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2004
Location: ljubljana, slovenia
Posts: 678
|
to sell them to spammers >:)
|
|
|
|
|
|
#17 |
|
does not play well with others
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2003
Location: Munich, Germany
Posts: 1,370
|
momos, i think we have to dig a little deeper.
Books can be written on validation and on email validation in particular. My very personal opinion is that all this validation mambo jumbo should be kept very simple. You cannot proof everything a 100% anyway. Too often i ran into the situation that a correct entry was refused because of some weired rules. And that becomes true if you're dealing with different countries where names, zip codes telefon numbers etc vary from country to country substantually. Back to email validation. Why one need to provide an email address? To get a newsletter, a confirmation of the purchase at an online shop etc. So, if i provide a wrong email address intentionally, what sense would that make? Maybe there's a typo in the address. That may happen. Makes sense for a checking in this case. If the email address is a substantial part of whatever you provide, you can use a confirmation input of it, ie the user has to type it twice (as eg the password). Anyway, i'm checking just the format of the email address and that's fine with me. Other people may have other requirements (and of course opinions) and want a much stronger validation. Just bear in mind: Nothing is bullet proof. and i'd like to add: Therefore KISS ![]() |
|
|
|
|
|
#18 | ||
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2004
Location: Belgium
Posts: 919
|
Quote:
Quote:
Anyway I do understand that you check the general form(or more) of the email-address; been there done that (http://www.sitepoint.com/forums/showthread.php?t=167372), but as you also said, there is still a possibility that the validation keeps you from entering your - possibly very strange albeit - perfectly valid email. |
||
|
|
|
|
|
#19 |
|
Keep it simple, stupid!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Posts: 1,897
|
The use of checkdnsrr() and getmxrr() for validating email addresses shows a complete lack of knowledge of the pertinent RFC. According to RFC 2821 when no mail exchangers are listed, hostname itself should be used as the only mail exchanger with a priority of 0. This is a configuration I have used many times and in fact the only time an MX record is needed is when the webserver and smtp server are at different IPs.
|
|
|
|
|
|
#20 |
|
Keep it simple, stupid!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Posts: 1,897
|
Even if you go to the extent of connecting to the remote mailserver and the mailserver agrees to accept mail for that address it still does not prove the address exists, only that the remote server will accept mail for it. The only sure way to know an email is good is to send an email to it containing a token and wait for confirmation.
|
|
|
|
|
|
#21 |
|
SitePoint Enthusiast
![]() Join Date: Jan 2006
Posts: 32
|
PHP Code:
For more informations, visit: www.xpertmailer.com |
|
|
|
|
|
#22 |
|
SitePoint Member
Join Date: Apr 2007
Posts: 1
|
i use this software: http://www.email-unlimited.com/email_verifier.html
or this compontnt: http://www.email-unlimited.com/email...component.html |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 04:44.






. Its probably an anti-spam policy.



For more informations, visit: 


Hybrid Mode
