{"id":19362517,"url":"https://github.com/fedek6/tld-mail-validator","last_synced_at":"2025-08-07T22:53:07.645Z","repository":{"id":62503867,"uuid":"348282317","full_name":"fedek6/tld-mail-validator","owner":"fedek6","description":"PHP e-mail address validator using list of all known TLDs","archived":false,"fork":false,"pushed_at":"2021-07-08T10:24:56.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-06T20:27:17.801Z","etag":null,"topics":["mail","mail-validation","php","tld","validator"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fedek6.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-16T09:14:50.000Z","updated_at":"2021-07-20T12:50:15.000Z","dependencies_parsed_at":"2022-11-02T12:31:06.499Z","dependency_job_id":null,"html_url":"https://github.com/fedek6/tld-mail-validator","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/fedek6%2Ftld-mail-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedek6%2Ftld-mail-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedek6%2Ftld-mail-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedek6%2Ftld-mail-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fedek6","download_url":"https://codeload.github.com/fedek6/tld-mail-validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240483777,"owners_count":19808632,"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":["mail","mail-validation","php","tld","validator"],"created_at":"2024-11-10T07:28:46.195Z","updated_at":"2025-02-24T12:49:04.083Z","avatar_url":"https://github.com/fedek6.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TLD e-mail validator\n\n[![Build Status](https://travis-ci.com/fedek6/tld-mail-validator.svg?token=Fpapy2MXqrwtfsLgfThp\u0026branch=main)](https://travis-ci.com/fedek6/tld-mail-validator)\n\nPHP e-mail address validator using list of all known [TLDs](https://data.iana.org/TLD/tlds-alpha-by-domain.txt) and simple domain MX record check. With ability to automatically update top-level domains list.\n\n## Usage example\n\n```php\nuse Fedek6\\TldMailValidator\\TldMailValidator;\n\n/** @var string $tldsFilePath  */\n$tldsFilePath = __DIR__ . '/../data/tlds-alpha-by-domain.txt';\n\n/** @var array $addresses */\n$addresses = require __DIR__ . '/addresses.php';\n\n/** @var \\Fedek6\\TldMailValidator\\TldMailValidator $validator */\n$validator = new TldMailValidator($tldsFilePath);\n\nif ($validator-\u003evalidate('janbrzechwa@mail.ru')) {\n    echo 'This is email is OK. and has proper actual tld.';\n} else {\n    echo 'Something\\'s wrong with this address';\n}\n```\n\nIf you want to test also MX record of a domain (slower), pass second argument to the constructor:\n\n```php\n/** @var \\Fedek6\\TldMailValidator\\TldMailValidator $validator */\n$validator = new TldMailValidator($tldsFilePath, TldMailValidator::TEST_ALL);\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\nOr: \n\n```bash\n./vendor/bin/phpunit --testdox --verbose --colors tests\n```\n\n### Test one file\n\n```bash\nvendor/bin/phpunit --testdox --verbose --colors tests/RemoteFileUpdaterTest.php\n```\n\n### Dry run before deploy\n\n```bash\nphp -f examples/mx.php\nphp -f examples/simple.php\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedek6%2Ftld-mail-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedek6%2Ftld-mail-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedek6%2Ftld-mail-validator/lists"}