2017 © Pedro Peláez
 

library email-validator

Small PHP library to valid email addresses using a number of methods.

image

nojacko/email-validator

Small PHP library to valid email addresses using a number of methods.

  • Tuesday, August 9, 2016
  • by nojacko
  • Repository
  • 6 Watchers
  • 103 Stars
  • 52,144 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 9 Forks
  • 1 Open issues
  • 9 Versions
  • 12 % Grown

The README.md

Email Validator

Small PHP library to valid email addresses using a number of methods., (*1)

License Build Status Code Quality Downloads Github Stars, (*2)

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)

composer require nojacko/email-validator:~1.0

Usage

Generalised Functions

  • isValid($email) Runs all the tests within this library. Returns true or false.
  • isSendable($email) Checks isEmail, isExample and hasMx. Returns true or false.

Specific Functions

If you want more control, use these functions seperately., (*3)

  • isEmail($email) Note: returns true or false only.
  • isExample($email)
  • isDisposable($email)
  • isRole($email)
  • hasMx($email)

These functions take a single argument (an email address) and return:, (*4)

  • 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

$validator = new \EmailValidator\Validator();

$validator->isValid('example@google.com');              // true
$validator->isValid('abuse@google.com');                // false
$validator->isValid('example@example.com');             // false

$validator->isSendable('example@google.com');           // true
$validator->isSendable('abuse@google.com');             // true
$validator->isSendable('example@example.com');          // false

$validator->isEmail('example@example.com');             // true
$validator->isEmail('example@example');                 // false

$validator->isExample('example@example.com');           // true
$validator->isExample('example@google.com');            // false
$validator->isExample('example.com');                   // null

$validator->isDisposable('example@example.com');        // false
$validator->isDisposable('example@mailinater.com');     // true
$validator->isDisposable('example.com');                // null

$validator->isRole('example@example.com');              // false
$validator->isRole('abuse@example.com');                // true
$validator->isRole('example.com');                      // null

$validator->hasMx('example@example.com');               // false
$validator->hasMx('example@google.com');                // true
$validator->hasMx('example.com');                       // null

Contribute

Contributions welcome!, (*5)

Requirements

Add/Remove Disposable Domain

See the email-data-disposable project., (*6)

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., (*7)

Other Contributions

For anything that isn't a new feature (bug fix, tests, etc) just create a pull request., (*8)

Testing

Test are all located in tests folder., (*9)

Run tests with phpunit. In root folder, execute phpunit in a CLI., (*10)

Versioning

Semantic Versioning 2.0.0, (*11)

License

The MIT License (MIT). See LICENCE file., (*12)

The Versions

09/08 2016

dev-master

9999999-dev

Small PHP library to valid email addresses using a number of methods.

  Sources   Download

MIT

The Requires

 

email library validation role check checker disposable email address mx throwaway validater

09/08 2016

1.1.2

1.1.2.0

Small PHP library to valid email addresses using a number of methods.

  Sources   Download

MIT

The Requires

 

email library validation role check checker disposable email address mx throwaway validater

15/12 2015

1.1.1

1.1.1.0

Small PHP library to valid email addresses using a number of methods.

  Sources   Download

MIT

The Requires

 

email library validation role check checker disposable email address mx throwaway validater

24/09 2015

1.1.0

1.1.0.0

Small PHP library to valid email addresses using a number of methods.

  Sources   Download

MIT

The Requires

 

email library validation role check checker disposable email address mx throwaway validater

03/02 2015

1.0.1

1.0.1.0

Small PHP library to valid email addresses using a number of methods.

  Sources   Download

MIT

email library validation role check checker disposable email address mx throwaway validater

11/11 2014

1.0.0

1.0.0.0

Email Validator

  Sources   Download

MIT

28/10 2014

0.2.0

0.2.0.0

Email Validator

  Sources   Download

MIT

23/10 2014

0.1.1

0.1.1.0

Email Validator

  Sources   Download

MIT

21/10 2014

0.1.0

0.1.0.0

Email Validator

  Sources   Download

MIT