Ok basically im trying to retrieve my emails off the gmail server using the pop server. Any idea how the pop protocol is described??
Heres my current script:
PHP Code:<?php
$host = "pop.gmail.com";
$port = "995";
$ip = gethostbyname($host);
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$result = socket_connect($socket, $ip, $port);
$in = "HEAD / POP\r\n";
$in .= "Host: pop.gmail.com\r\n";
$in .= "Connection: Close\r\n\r\n";
$out = '';
socket_write($socket, $in, strlen($in));
while ($out = socket_read($socket, 2048)) {
echo $out;
}
echo "Closing socket...";
socket_close($socket);
echo "OK.\n\n";
?>





Reply With Quote


