ProductPromotion
Logo

PHP

made by https://0x3d.site

GitHub - nojacko/email-validator: Small PHP library to valid email addresses using a number of methods.
Small PHP library to valid email addresses using a number of methods. - nojacko/email-validator
Visit Site

GitHub - nojacko/email-validator: Small PHP library to valid email addresses using a number of methods.

GitHub - nojacko/email-validator: Small PHP library to valid email addresses using a number of methods.

Email Validator

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

License Build Status Code Quality Downloads Github Stars

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.

  • 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:

  • 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('[email protected]');              // true
$validator->isValid('[email protected]');                // false
$validator->isValid('[email protected]');             // false

$validator->isSendable('[email protected]');           // true
$validator->isSendable('[email protected]');             // true
$validator->isSendable('[email protected]');          // false

$validator->isEmail('[email protected]');             // true
$validator->isEmail('example@example');                 // false

$validator->isExample('[email protected]');           // true
$validator->isExample('[email protected]');            // false
$validator->isExample('example.com');                   // null

$validator->isDisposable('[email protected]');        // false
$validator->isDisposable('[email protected]');     // true
$validator->isDisposable('example.com');                // null

$validator->isRole('[email protected]');              // false
$validator->isRole('[email protected]');                // true
$validator->isRole('example.com');                      // null

$validator->hasMx('[email protected]');               // false
$validator->hasMx('[email protected]');                // true
$validator->hasMx('example.com');                       // null

Contribute

Contributions welcome!

Requirements

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 tests folder.

Run tests with phpunit. In root folder, execute phpunit in a CLI.

Versioning

Semantic Versioning 2.0.0

License

The MIT License (MIT). See LICENCE file.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory