Quick links: Source code | Email address validation service
[UPDATED 15 March 2011]
In an attempt to draw a line under my efforts to validate email addresses properly, I’ve rewritten is_email() from scratch. It’s now ready for public inspection although not quite ready for release.
The beta version can be downloaded from here: https://code.google.com/p/isemail/source/browse/PHP/beta
More interestingly, there’s a test page here https://www.dominicsayers.com/source/beta/is_email/test where you can try your own favourite edge and corner cases. Click on Run All Tests to see the tests cases compiled by me and Michael Rushton.
The version 3.0 code has now been released here. You can validate email addresses here. And you can see the test cases run against the validator here.
What you can now see is
- Exactly what's wrong with the address (if anything)
- Is it valid for a normal use case (e.g. validating a registration form)
- Under what circumstances you can use it
- The appropriate ABNF code from the RFCs that define acceptable email addresses
Much of the code is now data driven so I can add new test cases and enhance the analysis without rewriting it.
It’s all free.