https://github.com/devnix/mailcheck
Validate and suggest email addresses for your inputs in PHP
https://github.com/devnix/mailcheck
Last synced: 8 months ago
JSON representation
Validate and suggest email addresses for your inputs in PHP
- Host: GitHub
- URL: https://github.com/devnix/mailcheck
- Owner: devnix
- License: gpl-3.0
- Created: 2019-11-12T11:10:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-23T10:37:46.000Z (about 5 years ago)
- Last Synced: 2025-05-28T06:43:54.794Z (9 months ago)
- Language: PHP
- Homepage:
- Size: 70.3 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mailcheck for PHP
[](https://github.com/devnix/mailcheck/actions?query=workflow%3ATests)
Validate and suggest emails for your email inputs
## Disclaimer
This library uses by default a public data source to suggest various know email
providers.
As this list is pretty much a work in progress you may be missing some domains,
so please feel free to open an issue or a pull request to improve it.
## Installation
`composer require devnix/mailcheck`
## Usage
You just need to initialize an instance to get a shiny suggestion service!
```php
use Devnix\Mailcheck\Mailcheck;
$mailcheck = new Mailcheck();
```
Then you can ask for an array of suggestions, ordered by Levenshtein distance...
```php
$mailcheck->suggest('example@gmil.com');
```
```
array:5 [
0 => "example@gmail.com"
1 => "example@gmx.com"
2 => "example@mail.com"
3 => "example@email.com"
4 => "example@ymail.com"
]
```
...or just the first coincidence
```php
$mailcheck->suggestOne('example@gmil.com');
```
```
"example@gmail.com"
```
## Contributing
You can help by reporting bugs, submitting pull requests, providing feedback
about your needs or bad suggestions.
You can execute all the tests by rugging `composer test`. We use tools like
[PHPStan](https://github.com/phpstan/phpstan),
[PHPUnit](https://github.com/sebastianbergmann/phpunit), and
[PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer). We like to follow
the [Symfony Coding Standards](https://symfony.com/doc/current/contributing/code/standards.html).