{"id":13877770,"url":"https://github.com/zytzagoo/smtp-validate-email","last_synced_at":"2025-07-16T13:32:37.856Z","repository":{"id":491712,"uuid":"118088","full_name":"zytzagoo/smtp-validate-email","owner":"zytzagoo","description":"A PHP library for performing email addresses validation via SMTP","archived":false,"fork":false,"pushed_at":"2022-09-12T14:02:38.000Z","size":160,"stargazers_count":446,"open_issues_count":24,"forks_count":157,"subscribers_count":36,"default_branch":"master","last_synced_at":"2024-11-14T12:09:53.125Z","etag":null,"topics":["email-validation","smtp"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zytzagoo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-01-30T15:25:37.000Z","updated_at":"2024-11-02T13:16:01.000Z","dependencies_parsed_at":"2022-07-04T19:32:05.953Z","dependency_job_id":null,"html_url":"https://github.com/zytzagoo/smtp-validate-email","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zytzagoo%2Fsmtp-validate-email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zytzagoo%2Fsmtp-validate-email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zytzagoo%2Fsmtp-validate-email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zytzagoo%2Fsmtp-validate-email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zytzagoo","download_url":"https://codeload.github.com/zytzagoo/smtp-validate-email/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226134226,"owners_count":17578778,"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-validation","smtp"],"created_at":"2024-08-06T08:01:23.519Z","updated_at":"2024-11-24T06:31:29.065Z","avatar_url":"https://github.com/zytzagoo.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# SMTP\\_Validate\\_Email\n\n[![PHP Version](https://img.shields.io/badge/php-5.6%2B-blue.svg?style=flat-square)](https://packagist.org/packages/zytzagoo/smtp-validate-email)\n[![Software License](https://img.shields.io/badge/license-gpl3%2B-brightgreen.svg?style=flat-square)](LICENSE.txt)\n![Tests](https://github.com/zytzagoo/smtp-validate-email/actions/workflows/tests.yaml/badge.svg)\n[![Build Status](https://img.shields.io/travis/zytzagoo/smtp-validate-email.svg?style=flat-square)](https://travis-ci.org/zytzagoo/smtp-validate-email)\n[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/zytzagoo/smtp-validate-email.svg?style=flat-square)](https://scrutinizer-ci.com/g/zytzagoo/smtp-validate-email/?branch=master)\n\nPerform email address validation/verification via SMTP.\n\nThe `SMTPValidateEmail\\Validator` class retrieves MX records for the email domain and then connects to the\ndomain's SMTP server to try figuring out if the address really exists.\n\nEarlier versions (before 1.0) used the `SMTP_Validate_Email` class name (and did not use namespaces and other now-common PHP features). Care has been taken to keep the old API and migrating old code should be painless. See [\"Migrating to 1.0 from older versions\"](#migrating-to-1.0-from-older-versions) section. Or just use/download the ancient [0.7 version](https://github.com/zytzagoo/smtp-validate-email/releases/tag/v0.7).\n\n## Features\n* Not actually sending the message, gracefully resetting the SMTP session when done\n* Command-specific communication timeouts implemented per relevant RFCs\n* Catch-all account detection\n* Batch mode processing supported\n* Logging/debugging support\n* No external dependencies\n* Covered with unit/functional tests\n\n## Installation\n\nInstall via [composer](https://getcomposer.org/):\n\n`composer require zytzagoo/smtp-validate-email --update-no-dev`\n\n## Usage examples\n\n### Basic example\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse SMTPValidateEmail\\Validator as SmtpEmailValidator;\n\n/**\n * Simple example\n */\n$email     = 'someone@example.org';\n$sender    = 'sender@example.org';\n$validator = new SmtpEmailValidator($email, $sender);\n\n// If debug mode is turned on, logged data is printed as it happens:\n// $validator-\u003edebug = true;\n$results   = $validator-\u003evalidate();\n\nvar_dump($results);\n\n// Get log data (log data is always collected)\n$log = $validator-\u003egetLog();\nvar_dump($log);\n```\n\n### Multiple recipients and other details\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse SMTPValidateEmail\\Validator as SmtpEmailValidator;\n\n/**\n * Validating multiple addresses/recipients at once:\n * (checking multiple addresses belonging to the same server\n * uses a single connection)\n */\n$emails    = [\n    'someone@example.org',\n    'someone.else@example.com'\n];\n$sender    = 'sender@example.org';\n$validator = new SmtpEmailValidator($emails, $sender);\n$results   = $validator-\u003evalidate();\n\nvar_dump($results);\n\n/**\n * The `validate()` method accepts the same parameters\n * as the constructor, so this is equivalent to the above:\n */\n$emails    = [\n    'someone@example.org',\n    'someone.else@example.com'\n];\n$sender    = 'sender@example.org';\n$validator = new SmtpEmailValidator();\n$results   = $validator-\u003evalidate($emails, $sender);\n\nvar_dump($results);\n```\n\n## Migrating to 1.0 from older versions\n\nEarlier versions used the global `SMTP_Validate_Email` classname.\nYou can keep using that name in your existing code and still switch to the newer (composer-powered) version by using [aliasing/importing](http://php.net/manual/en/language.namespaces.importing.php) like this:\n\nRequire the composer package:\n\n`composer require zytzagoo/smtp-validate-email --update-no-dev`\n\nAnd then in your code:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse SMTPValidateEmail\\Validator as SMTP_Validate_Email;\n\n// Now any old code referencing `SMTP_Validate_Email` should still work as it did earlier\n```\n\n## Development \u0026 Contributions\nSee the [Makefile](Makefile) and the development dependencies in [composer.json](composer.json).\n\nRunning `make` once you clone (or download) the repository gives you:\n\n```\nUsage: make [target]\n\n[target]                       help\n--------                       ----\nhelp                           What you're currently reading\ninstall                        Installs dev dependencies\nclean                          Removes installed dev dependencies\ntest                           Runs tests\ncoverage                       Runs tests with code coverage\nserver-start                   Stops and starts the smtp server\nserver-stop                    Stops smtp server if it's running\n(PIDFILE)                      Starts the smtp server\n(MAILHOG)                      Downloads platform-specific mailhog binary\n```\n\nSo, run `make install` to get started. Afterwards you should be able to run the tests (`make test`).\n\nTests are powered by `phpunit` and a local `./bin/mailhog` instance running on port 1025.\nTests requiring an SMTP server are marked as skipped (if/when the SMTP server is unavailable).\n\nPull requests are welcome!\n\nIn order to get your pull request merged, please follow these simple rules:\n\n* all code submissions must pass cleanly (no errors) with `make test`\n* stick to existing code style (`phpcs` is used)\n* there should be no external dependencies\n* if you want to add significant features/dependencies, file an issue about it first so we can discuss whether the addition makes sense for the project\n\n## [Changelog](CHANGELOG.md)\n\n## [License (GPL-3.0+)](LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzytzagoo%2Fsmtp-validate-email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzytzagoo%2Fsmtp-validate-email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzytzagoo%2Fsmtp-validate-email/lists"}