Email: connessione al server e verifica del nome utente

Gianluca1972

Nuovo Utente
9 Mag 2006
14
0
0
Ciao a tutti,
c'è qualcuno che ha già provato questo script?


$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]="Server rejected address";
return $result;

}
} else {

$result[0] = false;
$result[1] = "No response from server";
return $result;
}

} else {

$result[0]=false;
$result[1]="Can not connect E-Mail server.";
return $result;
}
 

Discussioni simili