PHP Classes

Bulk Email Verifier PHP script with class PHP Email validation: Determine if a given e-mail address is valid.

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (48)   Blog (2)    
Last Updated Ratings Unique User Downloads Download Rankings
2024-02-07 (5 months ago) RSS 2.0 feedStarStarStarStar 61%Total: 35,919 This week: 2All time: 12 This week: 36Down
Version License PHP version Categories
emailvalidation 1.0.19BSD License3Email, Networking, Validation


Class that may be used to determine if a given e-mail address is valid. It features:

- Simple validation just by looking at the e-mail address string
- Validation of the domain against a list of known domains that are often misspelled (typos) like those of,,,,,,,, etc.
- Provides did you mean like suggestions for email addresses that were entered with typos
- Validation of domain against a list of typical fake domains like,,,, etc..
- Validation of the email address domain against a list of of known domains for being used as disposable email addresses or temporary domains
- Manual whitelisting of domains to avoid trigger false positives of invalid domains
- Validation of the e-mail address domain checking the DNS MX record (mail exchange)
- Validation of a e-mail address by connecting to the mail host server to determine if there is really a deliverable mail box by simulating part of the message delivery process.

Picture of Manuel Lemos
  Performance   Level  
Name: Manuel Lemos is available for providing paid consulting. Contact Manuel Lemos .
Classes: 45 packages by
Country: Portugal Portugal
Age: 55
All time rank: 1
Week rank: 6 Down1 in Portugal Portugal Equal


What is the best PHP email verification class?
Bulk Verify Email Lists

What is the best PHP email address validation class?
Check if an email address exists

email validation
Bulk email validation

looking for email address verification script
can any one help me to find email verification php script

Find a php email validation class
I need to overcome malformed newlines in header


 * test_email_validation.html
 * @(#) $Header: /opt2/ena/metal/emailvalidation/test_email_validation.php,v 1.14 2024/02/07 12:19:09 mlemos Exp $

<title>Test for Manuel Lemos's PHP E-mail validation class</title>
<h1 align="center">Test for Manuel Lemos's PHP E-mail validation class</h1>

$validator=new email_validation_class;

/* how many seconds to wait before each attempt to connect to the
       destination e-mail server */

/* how many seconds to wait for data exchanged with the server.
       set to a non zero value if the data timeout will be different
         than the connection timeout. */

/* user part of the e-mail address of the sending user
       ( in this example) */

/* domain part of the e-mail address of the sending user */

/* Set to 1 if you want to output of the dialog with the
       destination mail server */

/* Set to 1 if you want the debug output to be formatted to be
    displayed properly in a HTML page. */

/* When it is not possible to resolve the e-mail address of
       destination server (MX record) eventually because the domain is
       invalid, this class tries to resolve the domain address (A
       record). If it fails, usually the resolver library assumes that
       could be because the specified domain is just the subdomain
       part. So, it appends the local default domain and tries to
       resolve the resulting domain. It may happen that the local DNS
       has an * for the A record, so any sub-domain is resolved to some
       local IP address. This prevents the class from figuring if the
       specified e-mail address domain is valid. To avoid this problem,
       just specify in this variable the local address that the
       resolver library would return with gethostbyname() function for
       invalid global domains that would be confused with valid local
       domains. Here it can be either the domain name or its IP address. */
$validator->invalid_email_domains_file = 'invalidemaildomains.csv';
$validator->invalid_email_servers_file = 'invalidemailservers.csv';
$validator->email_domains_white_list_file = 'emaildomainswhitelist.csv';

strlen($error = $validator->ValidateAddress($email, $valid)))
"<h2 align=\"center\">Error: ".HtmlSpecialChars($error)."</h2>\n";
"<h2 align=\"center\"><tt>$email</tt> is not a valid deliverable e-mail box address.</h2>\n";
$suggestion = $validator->suggestions[0];
$link = '?email='.UrlEncode($suggestion);
"<H2 align=\"center\">Did you mean <a href=\"".HtmlSpecialChars($link)."\"><tt>".HtmlSpecialChars($suggestion)."</tt></a>?</H2>\n";
"<h2 align=\"center\">It was not possible to determine if <tt>$email</tt> is a valid deliverable e-mail box address.</h2>\n";
"<h2 align=\"center\"><tt>$email</tt> is ".($result ? "" : "not ")."a valid deliverable e-mail box address.</h2>\n";
$email = '';
$link = '?email='.$email;
"<h2 align=\"center\">Access this page using passing the email to validate here: <a href=\"".HtmlSpecialChars($link)."\"><tt>".$email."</tt></a></h2>\n";

  • email_validation.gif
  Files folder image Files  
File Role Description
Accessible without login Plain text file test_email_validation.php Example E-mail validation test page script
Accessible without login Plain text file invalidemaildomains.csv Data Sample list of domains known to be invalid for email addresses
Accessible without login Plain text file emaildomainswhitelist.csv Data White list of domains to always be considered valid
Plain text file email_validation.php Class E-mail validation class
Accessible without login Plain text file invalidemailservers.csv Data Invalid email servers list
Accessible without login Plain text file invalidemailusers.csv Data List of invalid email address user names 20KB
Downloademailvalidation-2024-02-07.tar.gz 20KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
DNSResolver Download .zip .tar.gz If you are using Windows or any other platform on which the PHP function GetMXRR is not working, this class can provide an alternative Conditional
 Version Control Reuses Unique User Downloads Download Rankings  
This week:2
All time:12
This week:36Down
User Ratings User Comments (8)
 All time
By this code i am able to validate only domain, not validate ...
1 year ago (icert glob)
Thank you very useful package
3 years ago (Alberto Garelli)
Your class stays in conflict with the Single Responsibility P...
8 years ago (Matthias Kaschubowski)
Amazing and very Simple to use! I have seen a few Text Tutori...
10 years ago (Miklo)
The class is very helpful for me.
11 years ago (Khoa Nguyen)
14 years ago (kishore kumar)
Tried the ValidateEmailAddress() method to no avail.
16 years ago (G. S.)
very useful script
15 years ago (Lee J)