Michael Long
1 min readMar 10, 2020

--

As the links indicate, the only real way to validate a new email address is to send it a confirmation code. If they get a code and give that code back to you, then it’s valid.

If not, then it doesn’t matter if the email address is in the proper format or not. You’ve just put a junk email address into your system.

If you’re doing it for auth and you feel you must do some sort of client side validation, then it’s best to just check for an @, or at most regex for “.+@.+” (anything@anything), send it and the password to the API for validation, and be done with it.

Doing so also avoids internationalization issues with Latin-based addresses with diacritics (like ñoñó1234@server.com) or in non-Latin-based writing systems like Arabic, Russian, Japanese, or Chinese (伊昭傑@郵件.商務). All of the examples are permitted by RFC 6530.

“I clearly wouldn’t like my users to register with email having ip address after @ .”

Not really your call, is it? Besides, most modern apps and sites support username/email/password autofill and password managers, so it’s not like they’re forced to manually enter it each and every time.

“I didn’t get a single support request related to email validation.”

Or else they bailed and didn’t bother.

Actually, it’s funny you should mention that, in that I remember one site that didn’t like one of my email addresses for registration, so I tried contacting support only to have the same email address rejected on the support form.

Hey, at least they were consistent….

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

Responses (1)