|
|
|
|
|
by theandrewbailey
3031 days ago
|
|
Sorry, but .+@.+ isn't going to cut it if you want to confidently accept deliverable email addresses. Regex valid, but not email valid: codetrotter@example code@trotter@example.com code trotter@example.com codetrotter@example..com codetrotter@example.com. .codetrotter@example.com My company runs a website that has elderly people signing up for newsletters. The client is paranoid about not getting every last drop of possible data, and raises hell for every email address that isn't deliverable. There are LOTS of ways to easily ruin a simple email address. |
|
codetrotter@example.com
It conforms to the expectated format and could be a valid email, but it’s actually not because no such user exists.
An email might also exist, but not accept mail from you.
The given email address might exist, by could belong to another user.
There’s a million things that can go wrong and you’ll have a very hard time catching them.
The only way to identify if an email is valid and accepts mail is to actually send an email there.
You can, as a help for the user identify odd looking email addresses and flag them in the UI (“this looks unusual, are you sure”), but generally speaking, chances are high that any strict validation will reject real world addresses while not catching all errors.