I found a function that does email validation checking
function validate_email($email)
{
// Create the syntactical validation regular expression
$regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";
// Presume that the email is invalid
$valid = 0;
// Validate the syntax
if (eregi($regexp, $email))
{
list($username,$domaintld) = split("@",$email);
// Validate the domain
if (getmxrr($domaintld,$mxrecords))
$valid = 1;
} else {
$valid = 0;
}
return $valid;
}
It works well when giving a non-sense email address, like: grerg@rggerg, but when giving a correct domain name, or even just rggerg.com would cause the error.
When I use something like g44t24tr@yahoo.com. The error is 'Fatal error: Call to undefined function: getmxrr() in c:\program files\apache group'
Does anyone know why would this happen? Thanks.