成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

用php得到163的郵件信息

瀏覽:6日期:2024-02-17 09:08:19

<?$host='pop.163.com';$port=110;$user='******';$password='******';

if(!($sock=fsockopen(gethostbyname($host),$port,$errno,$errstr))) exit($errno.': '.$errstr);set_socket_blocking($sock,true);

$msg=fgets($sock);echo $msg;

$command='user '.$user.'rn';fwrite($sock,$command);$msg=fgets($sock);echo $msg;

$command='pass '.$password.'rn';fwrite($sock,$command);$msg=fgets($sock);echo $msg;

$command='statrn';fwrite($sock,$command);$msg=fgets($sock);echo $msg;

$command='listrn';fwrite($sock,$command);while(true){ $msg=fgets($sock) echo $msg; if(preg_match('/^./',$msg)) break;}

$command='retr 1rn';fwrite($sock,$command);while(true){ $msg=fgets($sock); echo $msg; if(preg_match('/^.(rn)$/',$msg)) break;}

$command='quitrn';fwrite($sock,$command);$msg=fgets($sock);echo $msg;?>

標(biāo)簽: PHP