I'm using PHPMailer and $mail->Send() is returning an error, my problem is when I use this email-string "[email protected]" within $mail->SetFrom(), but in the other hand it works fine with almost any other email i.e "[email protected]".
After debugging the code I found out that the problem is in the file class.phpmailer.php over the function ValidateAddress(). It seems that the email "[email protected]" is not valid by FILTER_VALIDATE_EMAIL nor the preg_match
PHPMailer - class.phpmailer.php - line 550:
public static function ValidateAddress($address) {
if (function_exists('filter_var')) { //Introduced in PHP 5.2
if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {
return false;
} else {
return true;
}
} else {
return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address);
}
}
Why is that possible?? does anyone have any idea what is going on??? why this email "[email protected]" is not allow?