Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
email@example.com
firstname.lastname@example.com
email@subdomain.example.com
firstname+lastname@example.com
email@123.123.123.123
email@[123.123.123.123]
"email"@example.com
1234567890@example.com
email@example-one.com
_______@example.com
email@example.name
email@example.museum
email@example.co.jp
firstname-lastname@example.com
List of Strange Valid Email Addresses
much.”more\ unusual”@example.com
very.unusual.”@”.unusual.com@example.com
very.”(),:;<>[]”.VERY.”very@\\ "very”.unusual@strange.example.com
List of Invalid Email Addresses
plainaddress
#@%^%#$@#$@#.com
@example.com
Joe Smith <email@example.com>
email.example.com
email@example@example.com
.email@example.com
email.@example.com
email..email@example.com
あいうえお@example.com
email@example.com (Joe Smith)
email@example
email@-example.com
email@example.web
email@111.222.333.44444
email@example..com
Abc..123@example.com
List of Strange Invalid Email Addresses
”(),:;<>[\]@example.com
just”not”right@example.com
this\ is"really"not\allowed@example.com
@sourashis59
Copy link

sourashis59 commented Sep 17, 2021

Alt Text
OK

@subodh0201
Copy link

subodh0201 commented Sep 17, 2021

Alt Text
OK

@skmaity32
Copy link

skmaity32 commented Sep 17, 2021

Alt Text

@ritwikrst
Copy link

ritwikrst commented Sep 17, 2021

Alt Text

@subodh0201
Copy link

subodh0201 commented Sep 17, 2021

Alt Text

@ritwikrst
Copy link

ritwikrst commented Sep 17, 2021

Alt Text

@skmaity32
Copy link

skmaity32 commented Sep 17, 2021

Alt Text

@subodh0201
Copy link

subodh0201 commented Sep 17, 2021

Write a Lex Program that will validate an E-mail address. Format
of an email address is local-part@domain
Local part of the E-mail address may use any of these ASCII
Characters:
a. uppercase and lowercase letters A to Z and a to z
b. digits, 0 to 9
c. Printable characters, !#$%&'*+-/=?^_`{|}~
d. dot ., provided that it is not the first or last character
and provided also that it does not appear consecutively
(e.g.,John..Doe@example.com is not allowed)
The domain name part of an email address has to conform to
strict guidelines:
a. uppercase and lowercase letters A to Z and a to z;
b. digits 0 to 9, provided that top-level domain names are not
all-numeric;
c. hyphen - , provided that it is not the first or last
character.
Example: example-indeed@strange-example.com (allowed).
A@b@c@example.com (not allowed - only one @ is allowed
outside quotation marks)

@Tajkurunzannat
Copy link

Tajkurunzannat commented Sep 23, 2021

email@123.123.123.123
email@[123.123.123.123]
these two mail ids are Invalid.

@lukasz-pekala
Copy link

lukasz-pekala commented Sep 23, 2021

email@123.123.123.123
email@[123.123.123.123]
these two mail ids are Invalid.

I also think so. I've swapped gmail.com for its ip address and did not receive an email
@Tajkurunzannat Did you find the RFC part stating that this is indeed invalid?

@ReedRodgers
Copy link

ReedRodgers commented Sep 23, 2021

ok

@IBUPltAppIconfont
Copy link

IBUPltAppIconfont commented Sep 28, 2021

image

@rohanharikr
Copy link

rohanharikr commented Oct 5, 2021

ok

@allanvobraun
Copy link

allanvobraun commented Oct 8, 2021

ok

@TokerX
Copy link

TokerX commented Oct 12, 2021

ok

But
much.”more\ unusual”@example.com and very.”(),:;<>[]”.VERY.”very@\ "very”.unusual@strange.example.com can't be valid. Within a quoted string backslashes and quotes still need to be escaped with a backslash. I just noticed that they will be removed when posting though lol, so they probably were typed correctly. Anyway, so the first one needs 2 backslashes after more and the second one needs to have two backslashes after very@ and a backslash before "very".unusual.
For the same reason just”not”right@example.com probably turned from an invalid one into a valid one lol.

@kyleishie
Copy link

kyleishie commented Oct 15, 2021

ok

@juliantejera
Copy link

juliantejera commented Oct 30, 2021

ok

@joweenflores
Copy link

joweenflores commented Nov 17, 2021

ok

@CoolBeans-Dev
Copy link

CoolBeans-Dev commented Nov 24, 2021

ok

@Lexus123
Copy link

Lexus123 commented Nov 30, 2021

ok

@Crashingberries
Copy link

Crashingberries commented Dec 1, 2021

ok

@pynner
Copy link

pynner commented Dec 1, 2021

ok

@jlalmes
Copy link

jlalmes commented Dec 3, 2021

ok

@guilhermerodrigues680
Copy link

guilhermerodrigues680 commented Dec 6, 2021

ok

@Heroco
Copy link

Heroco commented Dec 7, 2021

ok

@mweiss9676
Copy link

mweiss9676 commented Dec 16, 2021

ok

@william-lively
Copy link

william-lively commented Jan 10, 2022

ok

@GuiRosaAlves
Copy link

GuiRosaAlves commented Jan 18, 2022

ok

@ekscrypto
Copy link

ekscrypto commented Jan 22, 2022

I'll argue that if you list email@example.web as an invalid email address then you should also list email@123.123.123.123 has invalid. As per RFC5321 Section 4.1.2 address literals can only be used if they start with "[" and end with "]", and .123 is not a valid TLD as per Public Suffix List.

Also based on that same RFC5321 I would argue that your list of very unusual email addresses are actually all invalid. Local-part definition clearly indicate that you either have a Dot-string or a Quoted-string, not both and not a combination of both. None of your very unusual emails start with DQUOTE therefore would fall under the Dot-string validation rule which only allow Atom *("." Atom), atom being only 1*atext

@bw-varun
Copy link

bw-varun commented Jan 25, 2022

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment