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.
If you're going to test for at least 3 characters with a @ in the middle, you probably should implement some other simple rules to have a snowball's chance on the internet:
only one @
no spaces
has TLD (guarantee at least one period after @, and something else after, no consecutive periods)
can't begin or end with a period
You cannot validate an email address.
You can make a basic excruciatingly simple test for proper form. And should probably limit your checks to that.
For all else, attempt to use the email address provided for validation within your onboarding loop with a sufficiently unique verification URL or code. If that succeeds, the address is ... still not absolutely certainly valid, as it may have gone to a third party who proceeded to verify it. But at least it delivered to somebody.
See: https://hackernoon.com/the-100-correct-way-to-validate-email...
[1]: And "aaa" is a valid TLD; see the full list: https://www.iana.org/domains/root/db ; now, perhaps it is required to at least have a second level domain, but that's what I'm asking: is an MX record invalid on a TLD?
codetrotter@example
code@[email protected]
code [email protected]
[email protected]
[email protected].
[email protected]
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.