I'm sorry. I know you thought that validating an email address is simple, but I'm afraid that you're wrong here. It's a bit more complicated than you think. Quite a bit, actually. Allow me to illustrate:
What does an email address look like? For the most part, that's easy, right? We have a username, followed by an @ sign, followed by a domain name and we're done. For example: jschauma@netmeister.org. Simple enough.
Alas, it turns out that it's not that easy. And so to really understand what is valid (even if not necessarily widely accepted) and what is invalid (even if perhaps still accepted by some mail servers), we of course have to go back to the RFCs. We'll start out with RFC5321, and just to be comprehensive, we're strictly looking at the MAIL FROM / RCPT TO SMTP commands, as defined in Section 4.1.2. So let's start:...
https://www.netmeister.org/blog/email.html
#mail #email #validation
What does an email address look like? For the most part, that's easy, right? We have a username, followed by an @ sign, followed by a domain name and we're done. For example: jschauma@netmeister.org. Simple enough.
Alas, it turns out that it's not that easy. And so to really understand what is valid (even if not necessarily widely accepted) and what is invalid (even if perhaps still accepted by some mail servers), we of course have to go back to the RFCs. We'll start out with RFC5321, and just to be comprehensive, we're strictly looking at the MAIL FROM / RCPT TO SMTP commands, as defined in Section 4.1.2. So let's start:...
https://www.netmeister.org/blog/email.html
#mail #email #validation
www.netmeister.org
Your E-Mail Validation Logic is Wrong
Nope,
you don't know how to validate an email address. Even
if you think you'd get the domain part right,
fuggeddabout the local part. Seriously.
you don't know how to validate an email address. Even
if you think you'd get the domain part right,
fuggeddabout the local part. Seriously.