[thelist] Email Validator

Shaun Anderson shaunanderson at shaunanderson.info
Wed Dec 5 16:11:14 CST 2001


As somebody with a .info domain, I'd like to mention that this validation
won't let me enter my e-mail address.

I've had a few sites tell me that my e-mail address isn't valid.  I usually
just make it username at shaunanderson.inf. I assume that some don't like it
because it's a 4 letter TLD, and others because it isn't in their list of
domains like the code below (pretty rare).

Another problem with the code below would be people using country TLDs.
It's a rather long list and you'd have to keep on top of it an make changes
as necessary. (pita)

My personal opinion is that you should just make sure that there is an @
sign, and a period after, with 2+ characters after the last "."  If somebody
doesn't want to give you a "real" e-mail address, they just need to enter
asdf at asdf.com. It'll make it by any sort of validation you can through at
it. The only way you're going to get a real address from some people is to
tell them that you're going to give them what they want through e-mail.
(username/password usually)

Shaun

> I wrote a email validation function (PHP) a long time ago. Don't know how
> upto date it is, but you might find it interesting :
>
> function checkEmail($address)
>     {
>     if(ereg( "^[^@
> ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|net|com|gov|mil|org|edu|int)$",$ad
dress)
> )
>     return true;
>     else
>     return false;
>     }
>






More information about the thelist mailing list