Download the PHP package beeyev/disposable-email-filter-php without Composer

On this page you can find all versions of the php package beeyev/disposable-email-filter-php. 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 disposable-email-filter-php

🗑 Disposable email detection

Latest Version on Packagist Supported PHP Versions

PHP package that detects disposable (temporary/throwaway/fake) email addresses. It is framework-agnostic and has no dependencies, but includes support for Laravel. It validates email addresses to ensure they are genuine, which is useful for managing account sign-ups and assessing the number of legitimate email addresses in your system.
This tool also helps to avoid communication errors and blocks spam addresses.

🚀 The lookup is superfast O(1) because disposable email domains are stored locally using a native PHP hash set..

🚡 The list of disposable email domains is regularly updated automatically from trusted external sources.

📦 Installation and Usage examples

[!NOTE] Read below for Laravel specific instructions.

Require this package with composer using the following command:

Basic usage

Simple check if the email address is disposable:

Adding custom disposable(blacklisted) and whitelisted domains:

Note: Whitelisted domains have higher priority than blacklisted domains.

It is also possible to add blacklisted and whitelisted domains using constructor dependency:

Note: You can develop your own filtration logic by creating a custom class that implements the CustomEmailDomainFilterInterface

Handling exceptions:

If you try to pass empty string or string with invalid email format, an exception will be thrown.

If you expect that email address might be invalid and don't want to wrap the code into try/catch,
you can use isDisposableEmailAddressSafe method to check if email address is correctly formatted before checking if it's disposable:

Laravel specific usage

This package includes a service provider and form validation rule for Laravel.

Install the package (Laravel)

The package will be automatically registered using Laravel auto-discovery mechanism.
But if you need to do it manually, you can add the following line to the providers array in the config/app.php file:

Form validation (Laravel)

Use validation rule not_disposable_email or object new NotDisposableEmail(), to check that specific field does not contain a disposable email address.

[!NOTE] ❗ Place it after the email validator to ensure that only valid emails are processed.

Example:

Using facades (Laravel)

You can use the DisposableEmail facade to access the DisposableEmailFilter instance:

Config file and translations (Laravel)

Optionally, you can publish the config file and translations to customize the package behavior:

This command will create a disposable-email-filter.php config file in the config directory and translation files in the lang/vendor/disposable-email-filter directory.

Updating

Since the list of disposable email domains is regularly updated, it is important to keep the package up to date.
A new PATCH version of the package is released whenever the list is updated.
These updates are safe and non-breaking, allowing you to update the package via this composer command:

You can run this command every time in CI/CD pipelines before the project is deployed.

Contribution

Feel free to contribute to this project if you want to add new features, improve existing ones, or fix bugs.
To add new disposable domains, you can update the blacklist.txt file and create a pull request.
Alternatively, you can open an issue with the domains you want to be added to the blacklist or whitelist.

External Sources:

Local blacklist and whitelist are stored in the blacklist.txt and whitelist.txt files.

Issues

Bug reports and feature requests can be submitted on the Github Issue Tracker.

© License

The MIT License (MIT). Please see License File for more information.


If you love this project, please consider giving me a ⭐


All versions of disposable-email-filter-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^8.0
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 beeyev/disposable-email-filter-php contains the following files

Loading the files please wait ....