PHP function to validate if an email address is valid or not.
This function includes checking for email injections, syntax formatting, dns checking, and a few basic TLD corrections.
Here is how you use the email_IsValid()
function:
$Email = 'foo@.com';
//
if ( !email_IsValid($Email) ) {
//
die('The email address you entered does not appear to be a valid email address.');
//
}
This function requires that you have access to the idn_to_ascii() function, which requires your PHP server have intl installed, if you want the dns check to perform.
The MIT License (MIT). Please see License File for more information.