News for hackers. Stuff that matters.
Re:Email Regex that works 99.99% by madaxe_again on Sunday February 22, 2015 @09:07AM (#9089452)
Or, if you want to do something inbetween the two, and be reasonably certain it's a real email but not having to have the customer validate, do a quick MX lookup on the domain they supply (cache these on a local bind instance or whatever if you like), and if you really want to go a step further, send a quick HELO and headerset to the remote SMTP server (many libraries will do this for you), and see if responds with a 250.

Of course, all this takes time, so you always have a tradeoff between speed and validation level, from full-on user-validated email to "enter whatever".

There are no comments on this comment yet.