{"id":16329470,"url":"https://github.com/elliotjreed/disposable-emails-filter-php","last_synced_at":"2025-04-05T22:05:30.252Z","repository":{"id":46504421,"uuid":"173639004","full_name":"elliotjreed/disposable-emails-filter-php","owner":"elliotjreed","description":"A PHP package for determining whether an email address is from a disposable / temporary email address provider.","archived":false,"fork":false,"pushed_at":"2024-12-05T07:34:39.000Z","size":453,"stargazers_count":29,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-06T22:43:38.035Z","etag":null,"topics":["email","email-validation","email-verification","hacktoberfest","php"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/elliotjreed/disposable-emails-filter","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotjreed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-03T22:44:10.000Z","updated_at":"2024-12-05T07:34:43.000Z","dependencies_parsed_at":"2023-12-10T12:23:44.332Z","dependency_job_id":"43e2efb0-4dc0-4e29-b9f7-a83aa31832fd","html_url":"https://github.com/elliotjreed/disposable-emails-filter-php","commit_stats":{"total_commits":143,"total_committers":4,"mean_commits":35.75,"dds":0.4895104895104895,"last_synced_commit":"88a32bd390e2751d9dbdf54b0db3bf2751abbcf2"},"previous_names":[],"tags_count":92,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotjreed%2Fdisposable-emails-filter-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotjreed%2Fdisposable-emails-filter-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotjreed%2Fdisposable-emails-filter-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotjreed%2Fdisposable-emails-filter-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotjreed","download_url":"https://codeload.github.com/elliotjreed/disposable-emails-filter-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406085,"owners_count":20933803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","email-validation","email-verification","hacktoberfest","php"],"created_at":"2024-10-10T23:15:43.515Z","updated_at":"2025-04-05T22:05:30.232Z","avatar_url":"https://github.com/elliotjreed.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)\n\n# Disposable / Temporary Email Address Filter\n\nThis package provides a method for determining whether an email address is a disposable / temporary email address.\n\nAll credit to the maintaining of the list of disposable / temporary email addresses goes to [github.com/disposable-email-domains/disposable-email-domains](https://github.com/disposable-email-domains/disposable-email-domains).\n\nThis project and it's maintainer(s) do not discourage the use of such disposable / temporary email addresses, but simply allows for the detection of such.\n\n## Installation\n\nPHP 8.2 or above is required. If PHP 8.1 is required please use version 4.  If PHP 7.4 to 8.0 is required please use version 3.\n\nTo install via [Composer](https://getcomposer.org/download/):\n\n```bash\ncomposer require elliotjreed/disposable-emails-filter\n```\n\n## Usage\n\n### Check if the email address is in the temporary domain list\n\nThe checker / filter can either be used via a static or non-static means:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse ElliotJReed\\DisposableEmail\\Email;\n\nif ((new Email())-\u003eisDisposable('email@temporarymailaddress.com')) {\n    echo 'This is a disposable / temporary email address';\n}\n```\n\nor\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse ElliotJReed\\DisposableEmail\\DisposableEmail;\n\nif (DisposableEmail::isDisposable('email@temporarymailaddress.com')) {\n    echo 'This is a disposable / temporary email address';\n}\n```\n\n### List all domains in the temporary email domain list\n\nThe lister can either be used via a static or non-static means:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse ElliotJReed\\DisposableEmail\\Email;\n\nforeach ((new Email())-\u003egetDomainList() as $domain) {\n    echo $domain . PHP_EOL;\n}\n```\n\nor\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse ElliotJReed\\DisposableEmail\\DisposableEmail;\n\nforeach (DisposableEmail::getDomainList() as $domain) {\n    echo $domain . PHP_EOL;\n}\n```\n\nIf an invalid [email address](https://www.ietf.org/rfc/rfc0822.txt) is provided then an `InvalidEmailException` is thrown, so it is advisable to check that the email address is valid first. For example:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse ElliotJReed\\DisposableEmail\\Email;\n\n$email = 'not-a-real-email-address#example.net';\n\nif (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n    if ((new Email())-\u003eisDisposable($email)) {\n        echo 'This is a disposable / temporary email address';\n    }\n} else {\n    echo 'This is not a valid email address';\n}\n```\n\nWould output:\n\n```bash\nThis is not a valid email address\n```\n\nYou can also provide your own custom domain list in a new line separated plain-text file, for example:\n\n```text\nexample.com\nexample.net\n```\n\nThen passing the file location into the constructor:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse ElliotJReed\\DisposableEmail\\Email;\n\nnew Email('/path/to/custom/list.txt');\n```\n\nIf an invalid list is provided then an `InvalidDomainListException` is thrown.\n\n###\n\n## Getting Started with this Repository\n\nPHP 7.4 or above and Composer is expected to be installed on our system.\n\n### Installing Composer\n\nFor instructions on how to install Composer visit [getcomposer.org](https://getcomposer.org/download/).\n\n### Installing the Package\n\n```bash\ncomposer require elliotjreed/disposable-emails-filter\n```\n\n### Installing for Development\n\nAfter cloning this repository, change into the newly created directory and run\n\n```bash\ncomposer install\n```\n\nor if you have installed Composer locally\n\n```bash\nphp composer.phar install\n```\n\nThis will install all dependencies needed for the project.\n\n## Running the Tests\n\nAll tests can be run by executing\n\n```bash\ncomposer run-script test\n```\n\n`phpunit` will automatically find all tests inside the `test` directory and run them based on the configuration in the `phpunit.xml` file.\n\n## Built With\n\n  - [github.com/disposable-email-domains/disposable-email-domains](https://github.com/disposable-email-domains/disposable-email-domains)\n  - [PHP](https://secure.php.net/)\n  - [Composer](https://getcomposer.org/)\n  - [PHPUnit](https://phpunit.de/)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENCE](LICENCE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotjreed%2Fdisposable-emails-filter-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotjreed%2Fdisposable-emails-filter-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotjreed%2Fdisposable-emails-filter-php/lists"}