|
Posted by Manuel Lemos on 09/21/05 21:43
Hello,
on 09/21/2005 02:49 PM Jim Moseby said the following:
> I threw together this totally untested and unreliable code to solicit
> comments on whether or not this is a good way to validate emails.
Consider
> the following:
> So, what is the general thought about validating email addresses in this
> manner?
This may work but your code has several problems like not handling long
lines, multiline SMTP responses and grey listing. That may cause your
code to break with some SMTP servers or give false negatives.
Instead of re-inventing the wheel, you may want to try this popular
class for validation of e-mail addresses that can check the destination
SMTP server but it handles correctly the problems I mentioned above:
http://www.phpclasses.org/emailvalidation
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Navigation:
[Reply to this message]
|