34

Does anyone know of a list of email addresses (which don’t need to be real) I can use for an email validation assembly for a unit test?

I’ve been looking for such a list and can’t seem to find one. I’m not looking for real addresses, just ones that fit, and the more things I can throw at the test the better. I’ve got 10 right now, but if there is a list, it would give me a more thorough test.

dakab
  • 5,379
  • 9
  • 43
  • 67
michael
  • 403
  • 1
  • 5
  • 8

4 Answers4

26

I believe you were looking for something like this:

List of Valid and Invalid Email Addresses

KonstantinK
  • 757
  • 1
  • 8
  • 23
5

Check the tests of the Apache Commons EmailValidator class:

The EmailValidatorTest in the Hibernate Validator also contains some address.

palacsint
  • 28,416
  • 10
  • 82
  • 109
2

Here is a set of test emails that Dominic Sayers uses to test his isEmail validator:

http://code.iamcal.com/php/rfc822/tests/

For more on isEmail:

http://isemail.info/about

james.garriss
  • 12,959
  • 7
  • 83
  • 96
Alex
  • 31
  • 2
  • 2
    That list you've linked to looks quite useful at first glance, but your (overly brief) answer seems to pull that list out of its context. Could you comment a little on it? For example, what "test suite" or project does it belong to? What do the "Expected" / "Strict Mode" / "Public Mode" columns mean? Is it up-to-date? etc. – stakx - no longer contributing Jul 20 '12 at 16:01
  • No, it's not out of context. Sayer's tool has a DSN lookup feature. http://isemail.info/about. https://code.google.com/p/isemail/issues/list. – james.garriss Jun 16 '14 at 16:12
  • Having said that, @Alex, it's always best to give a bit of context when giving an answer so that it's not a link-only answer. – james.garriss Jun 16 '14 at 16:13
2

I like to use the set in this page on email validating regexes because the addresses contain what they're testing inside the email address.

Bryan Anderson
  • 15,969
  • 8
  • 68
  • 83