What is valid email?
How do you know? How do you validate an email?
Which of these emails are valid?
- email@example.com ==Valid
- hi@ ==Invalid. No domain
- firstname.lastname@example.org ==Valid
- email@example.com ==Valid
- stavros.@stavros.io ==Invalid. Can't have dot at the end
- stavros..firstname.lastname@example.org ==Invalid --- Can't have two dots in a row -!#$%&'#(-/=?@stavros.io ==Invalid
- email@example.com == Valid
- #$%!^/&@stavros.io ==Valid
- h(a)firstname.lastname@example.org ==Invalid. No parentheses allowed! (Are you kidding me?)
- (sta)email@example.com ==Valid. Its comment and will be ignored by the mail server -firstname.lastname@example.org(io) ==Still Valid
- em@email@example.com ==Invalid. Because you have two at signs
- "<\"@\".!#%$@stavros.io ==Invalid
- <\"@\".!#%$@stavros.io ==Invalid
- "hi@you"@stavros.io ==Valid. You can have quoted at sign
- "hi you"@stavros.io ==Valid.
- " "@stavros.io ==Valid.
- hi"@"firstname.lastname@example.org ==Invalid. Qoutes must be dot-sparated
This video is amazingly mind blowing. You have to watch it if you have ever done email validation and thought you got it right. You will be puzzled.
The list above is not complete