3 ms·
I would advise against doing anything more than checking for an @... and, I guess, at least one character on either side of that. Just send a verification link
by Quekid5 4y ago
I would advise against doing anything more than checking for an @... and, I guess, at least one character on either side of that. Just send a verification link in an email instead.
(The fact that an email address is syntactically valid is a matter for SMTP/MTA implementers and syntactic validity doesn't mean that an email address actually receives mail.)
- upon_drumhead 4y agoExactly right. I'm so tired of systems that don't work with my .email domain or have rules that ".com" can't be on the left side of the @. We should be beyond this by now.
- jeroenhd 4y agoThis library will actually check DNS records to validate domains, so any TLD the server can reach will work with this library. It also has a thresholding system to allow you to pick how quirky the email addresses (and therefore, how full of typos) that you accept can be. You can set it up to accept RFC5322 addresses and tolerate up to certain levels of errors. The default is just "valid syntax", but DNS lookups and domains that violate the SMTP spec are tolerated if you use the (demonstrated) ISEMAIL_THRESHOLD check. I think this is the best email address validator I've seen. It sticks to the standards, at least those relevant when the software was last maintained, and doesn't do anything silly like regex checking. Validating through a mail server that just tries to send an email and hopes nobody made a typo is a burden on most users (typos are easy to make and weird email addresses should show a warning, though only completely invalid addresses should show an error) and can even lead to IP reputation damage for the mail server.
- deleted 4y ago[deleted]