PHP Classes
elePHPant
Icontem

PHP Email Address Validator: Validate email addresses using checklists

Recommend this page to a friend!
  Info   View files Example   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2018-02-23 (6 months ago) RSS 2.0 feedNot enough user ratingsTotal: 178 All time: 8,328 This week: 189Up
Version License PHP version Categories
php-email-address-va 1.0.0Custom (specified...5Email, PHP 5, Validation
Description Author

This package can validate email addresses using checklists.

It takes a given email address and checks if it may be possible to deliver messages to that address by connecting to the SMTP server that handles messages for the email address domain.

The package also checks the email address first against whitelist and blacklists, as well check if the email address domain is in a list of disposable email address domains.

Name: Enrico Sola <contact>
Classes: 5 packages by
Country: Italy Italy

Details

E-mail validator (PHP edition)

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.

E-mail validation

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.

E-mail provider check

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 folder image Files  
File Role Description
Accessible without login Plain text file blacklist.txt Doc. Documentation
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file demo.php Example Example script
Accessible without login Plain text file disposable.txt Doc. Documentation
Accessible without login Plain text file LICENSE.md Lic. License text
Plain text file php-email-address-validator.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file whitelist.txt Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:178
This week:0
All time:8,328
This week:189Up
User Comments (1)
Thats a very good class ;-) Great job
5 months ago (José Filipe Lopes Santos)
80%StarStarStarStarStar