he estado mirando en http://www.zend.com/zend/spotlight/ev12apr.php el código para comprobar si el mail exites... esta es la función:
Código PHP:
function comprobar_mail($Email){
global $HTTP_HOST;
$result = array();
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)) {
$result[0]=false;
$result[1]="$Email no éstá bien escrito";
return $result;
}
list ( $Username, $Domain ) = split ("@",$Email);
if (getmxrr($Domain, $MXHost)) {
$ConnectAddress = $MXHost[0];
}else{
$ConnectAddress = $Domain;
}
$Connect = fsockopen ($ConnectAddress, 25);
if ($Connect) {
if (ereg("^220", $Out = fgets($Connect, 1024))) {
fputs ($Connect, "HELO $HTTP_HOST\r\n");
$Out = fgets ( $Connect, 1024 );
fputs ($Connect, "MAIL FROM: <{$Email}>\r\n");
$From = fgets ( $Connect, 1024 );
fputs ($Connect, "RCPT TO: <{$Email}>\r\n");
$To = fgets ($Connect, 1024);
fputs ($Connect, "QUIT\r\n");
fclose($Connect);
if (!ereg ("^250", $From) || !ereg ( "^250", $To )) {
$result[0]=false;
$result[1]="El servidor rechaza la dirección";
return $result;
}
} else {
$result[0] = false;
$result[1] = "El servidor no responde.";
return $result;
}
}else {
$result[0]=false;
$result[1]="No se puede conectar con el E-mail server.";
return $result;
}
$result[0]=true;
$result[1]="$Email parece ser válido";
return $result;
} // end of function
Warning: fsockopen(): unable to connect to kkll.com:25 in /docroot/lib/scripts.php on line 138
la línea 138 es esta:
Código PHP:
$Connect = fsockopen ($ConnectAddress, 25);
Gracias!!!