This is the way.
TomasEkeli
joined 1 year ago
Almost correct. ^.+@.+$
Too hard to validate properly to be worth it. Even if it is technically valid that's insufficient. It must also work, and the easiest way to test that is to use it and verify that the user got what we sent.
I don't validate emails, I test them.
That's your email? OK, what did we send it? if we couldn't send to it or the user can't read it there's no reason to accept it.
OK, maybe I do some light validation first, but I don't trust the email address just because it's email-address-shaped.
if i can email them and the user gets it - fine by me