Download .zip |
Info | Example | View files (8) | Download .zip | Reputation | Support forum (2) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2018-02-23 (6 months ago) | Not enough user ratings | Total: 178 | All time: 8,328 This week: 189 |
Version | License | PHP version | Categories | |||
php-email-address-va 1.0.0 | Custom (specified... | 5 | Email, PHP 5, Validation |
Description | Author | |||||||||||||
This package can validate email addresses using checklists. |
|
A very simple library that allows you to validate an e-mail address, check if it exists through online connection and check if the provider is a disposable one or not.
String validation:
PHPEmailAddressValidator::validateString($email);
Complete validation:
PHPEmailAddressValidator::validate($email);
The complete validation will check address syntax first, after that will check for provider existence through DNS resolution and then will check if the given e-mail address exists.
Before using these methods you should set up dictionaries as following:
PHPEmailAddressValidator::setWhiteListDatabasePath('whitelist.txt');
PHPEmailAddressValidator::setBlackListDatabasePath('blacklist.txt');
PHPEmailAddressValidator::setDisposableProvidersDatabasePath('disposable.txt');
Check if the e-mail provider is accepted:
PHPEmailAddressValidator::isTrustedProvider($email, $disposableAllowed, $strict);
With accepted is meant that the provider is found within the given white list, if strict mode is not enabled, will be also checked if the provider is found within the black list, in this case will be returned "false". If the provider is checked using strict mode will be returned "true" only if it is found within the given white list. Both white list and black list must be plain text files and providers must be separated by a break line (\n).
Check if the e-mail provider is disposable:
PHPEmailAddressValidator::isDisposableProvider($disposable);
This method will check if the provider is included in the given list containing the disposable providers, a list with most common disposable providers is shipped with this library (kindly offered by @michenriksen). Disposable providers list must be plain text files and providers must be separated by a break line (\n).
Are you looking for the Node.js version? Give a look here.
Files |
File | Role | Description |
---|---|---|
blacklist.txt | Doc. | Documentation |
composer.json | Data | Auxiliary data |
demo.php | Example | Example script |
disposable.txt | Doc. | Documentation |
LICENSE.md | Lic. | License text |
php-email-address-validator.php | Class | Class source |
README.md | Doc. | Documentation |
whitelist.txt | Doc. | Documentation |
php-email-address-va-2018-02-23.zip 20KB | |
php-email-address-va-2018-02-23.tar.gz 19KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
User Comments (1) | |||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.