{"id":13622516,"url":"https://github.com/nojacko/email-validator","last_synced_at":"2026-01-10T20:52:12.940Z","repository":{"id":22146119,"uuid":"25477280","full_name":"nojacko/email-validator","owner":"nojacko","description":"Small PHP library to valid email addresses using a number of methods.","archived":true,"fork":false,"pushed_at":"2018-07-21T12:53:48.000Z","size":37,"stargazers_count":164,"open_issues_count":2,"forks_count":22,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-22T03:45:46.399Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/nojacko/email-validator","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/nojacko.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2014-10-20T17:14:03.000Z","updated_at":"2025-09-16T07:27:24.000Z","dependencies_parsed_at":"2022-08-19T18:00:42.798Z","dependency_job_id":null,"html_url":"https://github.com/nojacko/email-validator","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/nojacko/email-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nojacko%2Femail-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nojacko%2Femail-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nojacko%2Femail-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nojacko%2Femail-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nojacko","download_url":"https://codeload.github.com/nojacko/email-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nojacko%2Femail-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28258096,"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","status":"online","status_checked_at":"2026-01-10T02:00:06.867Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T21:01:20.403Z","updated_at":"2026-01-10T20:52:12.909Z","avatar_url":"https://github.com/nojacko.png","language":"PHP","readme":"# Email Validator\nSmall PHP library to valid email addresses using a number of methods.\n\n[![License](https://img.shields.io/github/license/nojacko/email-validator.svg)](https://github.com/nojacko/email-validator/blob/master/LICENSE)\n[![Build Status](https://img.shields.io/travis/nojacko/email-validator.svg)](https://travis-ci.org/nojacko/email-validator)\n[![Code Quality](https://img.shields.io/codacy/7b3a2c246622431abd1fc4e2750aae1b.svg)](https://www.codacy.com/app/nojacko/email-validator)\n[![Downloads](https://img.shields.io/packagist/dm/nojacko/email-validator.svg)](https://packagist.org/packages/nojacko/email-validator)\n[![Github Stars](https://img.shields.io/github/stars/nojacko/email-validator.svg)](https://github.com/nojacko/email-validator/stargazers)\n\n## Features\n* Validates email address\n* Checks for **example** domains (e.g. example.com)\n* Checks for **disposable** email domains (e.g. mailinator.com)\n* Checks for **role-based** addresses (e.g. abuse@)\n* Checks for **MX records** (i.e. can receive email)\n\n## Install (using Composer)\n```\ncomposer require nojacko/email-validator:~1.0\n```\n\n## Usage\n### Generalised Functions\n* ```isValid($email)``` Runs all the tests within this library. Returns true or false.\n* ```isSendable($email)``` Checks isEmail, isExample and hasMx. Returns true or false.\n\n\n### Specific Functions\nIf you want more control, use these functions seperately.\n\n* ```isEmail($email)``` Note: returns true or false only.\n* ```isExample($email)```\n* ```isDisposable($email)```\n* ```isRole($email)```\n* ```hasMx($email)```\n\nThese functions take a single argument (an email address) and return:\n\n* true, when function name is satisfied.\n* false, when function name is not satisfied.\n* null, when check is not possible, i.e. an invalid email is given.\n\n\n## Examples\n```\n$validator = new \\EmailValidator\\Validator();\n\n$validator-\u003eisValid('example@google.com');              // true\n$validator-\u003eisValid('abuse@google.com');                // false\n$validator-\u003eisValid('example@example.com');             // false\n\n$validator-\u003eisSendable('example@google.com');           // true\n$validator-\u003eisSendable('abuse@google.com');             // true\n$validator-\u003eisSendable('example@example.com');          // false\n\n$validator-\u003eisEmail('example@example.com');             // true\n$validator-\u003eisEmail('example@example');                 // false\n\n$validator-\u003eisExample('example@example.com');           // true\n$validator-\u003eisExample('example@google.com');            // false\n$validator-\u003eisExample('example.com');                   // null\n\n$validator-\u003eisDisposable('example@example.com');        // false\n$validator-\u003eisDisposable('example@mailinater.com');     // true\n$validator-\u003eisDisposable('example.com');                // null\n\n$validator-\u003eisRole('example@example.com');              // false\n$validator-\u003eisRole('abuse@example.com');                // true\n$validator-\u003eisRole('example.com');                      // null\n\n$validator-\u003ehasMx('example@example.com');               // false\n$validator-\u003ehasMx('example@google.com');                // true\n$validator-\u003ehasMx('example.com');                       // null\n```\n\n## Contribute\nContributions welcome!\n\n### Requirements\n* [Test-driven development](http://en.wikipedia.org/wiki/Test-driven_development)\n* Follow [PSR-2 Coding Style Guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)\n* One change per pull request\n\n### Add/Remove Disposable Domain\nSee the  [email-data-disposable](https://github.com/nojacko/email-data-disposable) project.\n\n### New Feature\nIf you're planning a new feature, please raise an issue first to ensure it's in scope. The aim is to keep this library small and with one specific purpose.\n\n### Other Contributions\nFor anything that isn't a new feature (bug fix, tests, etc) just create a pull request.\n\n\n## Testing\nTest are all located in ```tests``` folder.\n\nRun tests with phpunit. In root folder, execute ```phpunit``` in a CLI.\n\n\n## Versioning\n[Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html)\n\n## License\nThe MIT License (MIT). See LICENCE file.\n","funding_links":[],"categories":["Table of Contents","电子邮件 Email","PHP","目录","邮件( Email )"],"sub_categories":["Email","电子邮件 Email"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnojacko%2Femail-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnojacko%2Femail-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnojacko%2Femail-validator/lists"}