<?php
header('Content-Type: text/html; charset=utf-8');
$uname = "*****@gmail.com";
$pass = "*****";
$data[1] = "";
$k=0;
$fp = fsockopen('ssl://imap.gmail.com', '993', $errno, $errstr);
if(!$fp){
echo "WRONG!";
exit;
}else{
echo "OK!<br />";
fputs($fp, "USER $uname\r\n");
fputs($fp, "PASS $pass\r\n");
$message = fputs($fp, "STAT\r\n");
echo $message . "<br />";
$row = fputs($fp, "RETR 1\r\n");
while($k != 5){
$row = fgets($fp, 512);
$data[1] .= $row;
$k++;
}
echo $data[1];
//list($header, $body, ) = explode("\r\n\r\n", $data[1]);
//echo $body;
fputs($fp, "QUIT\r\n");
fclose($fp);
}
?>
这是什么?
OK Gimap ready for requests from 83.66.211.216 io5mb34879192bkb
USER BAD Unknown command io5mb34879192bkb
PASS BAD Unknown command io5mb34879192bkb
BAD invalid tag io5mb34879192bkb
RETR BAD Unknown command io5mb34879192bkb
如何在没有imap_open()
函数