Partager via


Email Address test cases

I've been on many teams in my whole testing career, and for some reason, I always end up getting assigned to validate the email address field.  So after numerous times of hunting down my old email test cases from previous team, I am giving up.  I thought I am just going to list out all of them here out on the internet.  I know that I probably going to have to refer to this list again and again in the future.  Might as well help benefit others like me.

Here is the list of valid and invalid email format which can be used for testing.  The list is not comprehensive by any means, and is probably missing a bunch of edge cases.  However, it provides enough coverage for the majority of the allowed/disallowed email address according to RFC 2822.

BTW, if anyone else would like to contribute more cases to this list, or spot errors (fingers crossed), please feel free to let me know and I'll make sure the list is up-to-date.

Valid Email address Reason
email@domain.com Valid email
firstname.lastname@domain.com Email contains dot in the address field
email@subdomain.domain.com Email contains dot with subdomain
firstname+lastname@domain.com Plus sign is considered valid character
email@123.123.123.123 Domain is valid IP address
email@[123.123.123.123] Square bracket around IP address is considered valid
"email"@domain.com Quotes around email is considered valid
1234567890@domain.com Digits in address are valid
email@domain-one.com Dash in domain name is valid
_______@domain.com Underscore in the address field is valid
email@domain.name .name is valid Top Level Domain name
email@domain.co.jp Dot in Top Level Domain name also considered valid (use co.jp as example here)
firstname-lastname@domain.com Dash in address field is valid

 

Invalid Email address Reason
plainaddress Missing @ sign and domain
#@%^%#$@#$@#.com Garbage
@domain.com Missing username
Joe Smith <email@domain.com> Encoded html within email is invalid
email.domain.com Missing @
email@domain@domain.com Two @ sign
.email@domain.com Leading dot in address is not allowed
email.@domain.com Trailing dot in address is not allowed
email..email@domain.com Multiple dots
あいうえお@domain.com Unicode char as address
email@domain.com (Joe Smith) Text followed email is not allowed
email@domain Missing top level domain (.com/.net/.org/etc)
email@-domain.com Leading dash in front of domain is invalid
email@domain.web .web is not a valid top level domain
email@111.222.333.44444 Invalid IP format
email@domain..com Multiple dot in the domain portion is invalid

 

 


Contributors

List of people who help contribute to help solidify the cases

gabriel.lozano-moran

bernie halpin

Avdhut

Comments

  • Anonymous
    February 05, 2009
    You forget 4 letter TLD's. Like .name ... I am saying this because often my email address does not get validated.

  • Anonymous
    February 05, 2009
    Valid email address: firstname-lastname@domain.com -- dash in username is valid (e.g. is valid for Windows Live ID).

  • Anonymous
    February 06, 2009
    Many thanks to both of you @gabriel.lozano-moran and @bernie halpin I have added more valid cases into the list above. Social test casing at its best.  :-)

  • Anonymous
    February 15, 2009
    Hay Chan, Is there any validation for the limit of numbers of dots present in the email domain? Thanks, Avdhut

  • Anonymous
    February 23, 2009
    The comment has been removed

  • Anonymous
    April 02, 2009
    It is very useful for me------- Thanks

  • Anonymous
    June 02, 2009
    I took over some unimpressive code that mostly worked. That said, the one thing that didn't work were email inputs like this: Email: me@home.com, me@work.com That is, two valid email addresses in one email input; usually this is bad.

  • Anonymous
    June 02, 2009
    The comment has been removed

  • Anonymous
    July 27, 2009
    Hi Pals, I am very very happy and impresses by seeing these comments and blogs regarding testing , and i would like to request you people to give a bit information regarding "URL" validations ,which can help me in my testing life. Email : nandhu28@ymail.com Regards, Nandhu

  • Anonymous
    November 09, 2009
    what above mentioned are common for all email promoters?

  • Anonymous
    March 04, 2010
    According to RFC 5322 Single quotes are valid for the first part of the email address, but many web applications fail this test even though it is quite common in corporate mail systems. ie.   Jim.O'Shea@domain.com

  • Anonymous
    April 21, 2010
    Can u give me calendar test case

  • Anonymous
    June 30, 2010
    The comment has been removed

  • Anonymous
    June 30, 2010
    Hi, I've checked for this email id : あいうえお@domain.com  - Unicode char as address If the DB is having Unicode char support, it is accepted. If I'm wrong correct me... Thanks, Pratiksha

  • Anonymous
    December 16, 2010
    email@domain.museum Reason: 6-letter TLD is valid.

  • Anonymous
    February 08, 2011
    Refer below mentioned URL: en.wikipedia.org/.../Email_address

  • Anonymous
    February 13, 2011
    Your Blog is one of the best top 100 software testing blogs listed in this article: www.testingminded.com/.../top-100-software-testing-blogs.html but for me, it's just one of the best! Keep the great work!


If you plan to go in Cameroon, please visit: <a href="offres-d-emploi-au-cameroun.blogspot.com/">Offres d'emploi au Cameroun</a>

  • Anonymous
    April 25, 2011
    shail@gmail.com.    is a Invalid ID  !

  • Anonymous
    May 26, 2011
    Useful and concise.  Thanks for sharing!

  • Anonymous
    May 30, 2011
    It was really help for unknown persons.....Thanks a lot....

  • Anonymous
    July 03, 2011
    The reasoning given in the table is that it is not a valid IP address - true, but it is valid domain address if you do not include TLD testing - 44444 is not a valid top level domain, otherwise this address would be valid.

  • Anonymous
    September 21, 2011
    The comment has been removed

  • Anonymous
    March 26, 2012
    email@domain.web email@-domain.com   is valid format or not ??

  • Anonymous
    April 03, 2012
    The comment has been removed

  • Anonymous
    June 13, 2012
    _______@domain.com Is This Really Valid Email Address???????????

  • Anonymous
    September 27, 2012
    ".web is not a valid top level domain" it can be, and it might be in the future and its still a valid email address if you use it.

  • Anonymous
    April 05, 2013
    The comment has been removed

  • Anonymous
    April 20, 2013
    (Space)Firstname@domain.com Reason : space not allowed. Thank you.

  • Anonymous
    June 23, 2013
    This is amazing sharing. Thank you very much

  • Anonymous
    July 26, 2013
    Can anyone tell me the Regular Expression validation to validate all above emails?

  • Anonymous
    November 12, 2013
    The comment has been removed

  • Anonymous
    November 22, 2013
    The Internet email message format is now defined by RFC 5322 en.wikipedia.org/.../RFC_2822

  • Anonymous
    March 10, 2014
    Hey, I guess  あいうえお@domain.com is valid email id. Please refer the below link en.wikipedia.org/.../International_email tools.ietf.org/.../rfc5335

  • Anonymous
    April 24, 2014
    It's really useful notes while testing any forms having email address.

  • Anonymous
    April 28, 2014
    Simply fabulous.  Thanx for providing such info.

  • Anonymous
    July 23, 2014
    The comment has been removed

  • Anonymous
    January 15, 2015
    Regular Expression for the above scenario var re = /^w+([.-]?w+)@w+([.-]?w+)(.w{2,3})+$/; http://jsfiddle.net/AkuXC/403/

  • Anonymous
    March 09, 2015
    The comment has been removed

  • Anonymous
    March 10, 2015
    Hi Chan , I came across online email/domain validation URL are accepting gg@gg.ZZZZ.com and email ids like this combination. Even online E-commerce sites are accepting this id. if sign up with this id you can directly get signed up. Do you have any idea regarding this ?

  • Anonymous
    March 29, 2015
    The comment has been removed

  • Anonymous
    March 30, 2015
    en.wikipedia.org/.../Email_address

  • Anonymous
    May 10, 2015
    The comment has been removed

  • Anonymous
    August 20, 2015
    _______@domain.com This is not valid email because RFC 3696 tools.ietf.org/.../rfc3696 requires: "Without quotes, local-parts may consist of any combination of alphabetic characters, digits, or any of the special characters ! # $ % & ' * + - / = ?  ^ _ ` . { | } ~ period (".") may also appear, but may not be used to start or end the local part, nor may two or more consecutive periods appear." Correct, please, the table "Valid Email address".

  • Anonymous
    September 02, 2015
    Can Comma (,) be used in email address?

  • Anonymous
    December 08, 2015
    Is '' valid in this emailid 'testw@a.com' ?