Download the PHP package nojacko/email-validator without Composer
On this page you can find all versions of the php package nojacko/email-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nojacko/email-validator
More information about nojacko/email-validator
Files in nojacko/email-validator
Package email-validator
Short Description Small PHP library to valid email addresses using a number of methods.
License MIT
Informations about the package email-validator
Email Validator
Small PHP library to valid email addresses using a number of methods.
Features
- Validates email address
- Checks for example domains (e.g. example.com)
- Checks for disposable email domains (e.g. mailinator.com)
- Checks for role-based addresses (e.g. abuse@)
- Checks for MX records (i.e. can receive email)
Install (using Composer)
Usage
Generalised Functions
- Runs all the tests within this library. Returns true or false.
- Checks isEmail, isExample and hasMx. Returns true or false.
Specific Functions
If you want more control, use these functions seperately.
- Note: returns true or false only.
These functions take a single argument (an email address) and return:
- true, when function name is satisfied.
- false, when function name is not satisfied.
- null, when check is not possible, i.e. an invalid email is given.
Examples
Contribute
Contributions welcome!
Requirements
- Test-driven development
- Follow PSR-2 Coding Style Guide
- One change per pull request
Add/Remove Disposable Domain
See the email-data-disposable project.
New Feature
If you're planning a new feature, please raise an issue first to ensure it's in scope. The aim is to keep this library small and with one specific purpose.
Other Contributions
For anything that isn't a new feature (bug fix, tests, etc) just create a pull request.
Testing
Test are all located in folder.
Run tests with phpunit. In root folder, execute in a CLI.
Versioning
License
The MIT License (MIT). See LICENCE file.