traq;11029213 wrote:actually, FILTER_VALIDATE_EMAIL doesn't enforce a TLD at all. Email addresses without one (e.g., [font=monospace]adrian@localhost[/font]) are perfectly valid; even though they're not typically "useful" to website operators (because they are not resolvable across the web).
[ So I see. If all the PTB leave it alone, I guess I really should, too. \
If it's important to you, you'll have to check for yourself. Be careful when building your whitelist, however - as laserlight says, you'll have to keep it up-to-date. Don't forget ccTLDs. And unicode. And remember that anyone (with enough money) can apply for arbitrary TLDs nowadays.
[ Hmm, that's something I didn't know about; arbitrary TLDs, that is. I don't think I'd have much of a problem with a white-list, actually. I'm leaning heavily in that direction. As I mentioned, it's a group that isn't likely to be using anything very unique anyway. And I don't mind locking out .biz and a bunch of others. ]
My approach is to put the onus on the user: if they want a response, the email address needs to be valid and reachable. I don't do anything important with the email address until after I confirm it (i.e., by getting a response from an emailed "verification" link). That's the only real measure of validity anyway.
[ Now, that's a great idea, actually. Instead of a Thank You page, I use the account itself to send an automated ack to the visitor that his message was received and he/she would receive a response shortly, after which I only need to look for a bounce before I respond. No bounce, it was most likely received at the address I was given. If that's not enough, then I could just add the "click Reply ... " note and give an address to an account only used for that one purpose. ]
edit
Also, using [font=monospace]<input type=email>[/font] will tip off modern browsers, and most will require an email with a TLD before allowing the form to submit.
(this is only a convenience, of course; and not reliable as validation.)