list of email addresses that can be used to test a javascript validation script
I've now collated test cases from Cal Henderson, Dave Child, Phil Haack, Doug Lovell and RFC 3696. 164 test addresses in all.
I ran all these tests against all the validators I could find. The comparison is here: http://www.dominicsayers.com/isemail
I'll try to keep this page up-to-date as people enhance their validators. Thanks to Cal, Dave and Phil for their help and co-operation in compiling these tests and constructive criticism of my own validator.
People should be aware of the errata against RFC 3696 in particular. Three of the canonical examples are in fact invalid addresses. And the maximum length of an address is 254 or 256 characters, not 320.
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on July 09, 2022Comments
-
Admin almost 2 years
Does anyone have a list of email addresses that I can use to test my JS address validation script? I'm looking for as complete of a list as is reasonable to test the most common edge cases, if not all cases.
-
Amit Patil over 15 yearsTesting for ‘.’ is also useful to catch the people who just put ‘hotmail’ with no TLD. We can, I think, safely assume no-one will be filling in an address @ a TLD itself.
-
some over 15 yearsI'm not sure if it is legal or not to have an address at the TLD. Technically it should be possible, but I am not aware of any that have it.
-
ptim almost 7 yearsOut of interest: @Dominc_Sayers commented on his linked page "Today I found someone with a working email address at a Top Level Domain. In other words an email address with no dots in the domain part. [...] he has an address at the Ukrainian TLD .ua" isemail.info/_system/is_email/test/?all
-
some almost 7 years@ptim With all the new TLDs there is an even larger chance that someone will have an email address at the TLD. To test if it could be an email address, check for a @ and (optional) convert all domain parts via punnycode to ASCII and check the length of each label.