Download the PHP package enricodias/email-validator without Composer

On this page you can find all versions of the php package enricodias/email-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package email-validator

emailValidator

Build Status Codacy Badge Codacy Badge Latest version Downloads total License

Validate and check for disposable/temporary/throw away emails.

Installation

Require this package with Composer in the root directory of your project.

Basic Usage

Service Providers

A service provider is a third party service that validates the email, usually using an API. You may register several providers to be used on the validation.

The registered providers will be used in sequence until one of them returns a valid response. This is especially useful if you want a provider to act as a failover.

MailCheck.ai is enabled by default.

Implemented providers

Provider Free Tier Cost per validation Unsupported Features
MailCheck.ai 120 verifications per hour Free
MailboxLayer 250 verifications per month $0.002 to $0.0006
NeverBounce 1000 verifications $0.008 to $0.003
Kickbox 100 verifications $0.010 to $0.004
Mailgun 0 $0.012 to $0.0025 **

* Validator.pizza is now called MailCheck.ai ** the feature is documented but as for now, the API never returns a suggestion.

Custom providers

You can add a custom provider by implementing the class . It's possible to remove the default MailCheck.ai provider using method or remove all all providers using method:

You can use the static method to create an instance and chain methods:

Note that providers registered without a name cannot be removed by .

Shuffle providers

Shuffling the service providers list is useful when using the free tier of multiple providers. Without shuffling, the providers will always be used in the same order resulting in unnecessary failures when the first provider runs out of credits.

How it works

The class checks locally if the email syntax is valid and if so, it calls a service provider.

Rate limit

Since most service providers are either paid or have a limit of requests per hour per ip, no request is made if the email doesn't pass on the local validation checks.

Local domain list

To lower the number of API requests the local checks include a list with the most common disposable domains. This list is intended to be short in order to not affect performance and avoid the need of constants updates. Wildcards are allowed.

Additional Domains

It's likely that the most popular disposable email services among your users are not on the default list, so you may want to customize the list using the method:

This method doesn't accepts a string, only an array.

Validation methods

isValid()

Returns if the email is valid.

The email is considered invalid if it fails on the local syntax check OR if it fails in the service provider's check. Note that disposable emails are valid emails.

isDisposable()

Returns if the email is a disposable email.

isAlias()

Returns if the email is an alias. Example: is an alias of .

didYouMean()

If the email has a simple and obvious typo such as instead of this method will return a string with a suggested correction, otherwise it will return an empty string.

It's recommended to use this feature using in the client side with an option for them to correct the email before submitting the form

isHighRisk()

Most service providers have a risk analysis tool. This method returns if the risk is high.


All versions of email-validator with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
guzzlehttp/guzzle Version ^6.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package enricodias/email-validator contains the following files

Loading the files please wait ....