No email validation can be perfect. It's a tradeoff. Personally I think filter_var() is so easy and accomplishes so much of the work that it's a good solution. There are other options and tradeoffs, but I don't see anything wrong with this on a practical level. And as traq said, the goal is just to sanitize the input for the form so that it's not used to send spam, etc.
In the end, there's almost no way at all (aside from sending an email to check) to know whether an email address is actually valid. You can check if the domain exists (or at least if it's currently responsive, which if so isn't proof that it can receive email or if not doesn't mean the server didn't just crash), but you can't check whether a particular email account exists.
Given that you can't get perfection, a simple and mostly effective strategy seems fine to me.
However, I would agree that the OP might want to look at what you've posted elsewhere (as have others) about checking whether the receiving domain is valid and so forth. There are times when that is useful.



Reply With Quote
Bookmarks