Hellzone
03-14-2005, 10:18 AM
Hey guys i'm having a little problem with PHP and a pop3 mail server, i've been required to make a fully skinnable webmail client for an associate of mine and initially i've been doing tests do work out how the mail servers work in relation to what i can do with php.
I've written the following code to login to the server and list messages but it only outputs the +OK for authentication and nothing else any idea whats going on?
$fp = fsockopen("pop.phreaker.net", 110, $errno, $errstr);
if (!$fp) {
echo "ERROR: $errno - $errstr<br />\n";
} else {
fputs($fp, "USER username\x0D\x0A");
$buffer .= fread($fp, 4096);
fputs($fp, "PASS password\x0D\x0A");
$buffer .= fread($fp, 4096);
fputs($fp, "LIST\x0D\x0A");
$buffer .= fread($fp, 4096);
fclose($fp);
echo $buffer;
}
and the output is
+OK +OK +OK
and after glancing at the code its quite possible it is only displaying the data from the initial command and nothing else! when using the same code with a different pop server i do get 3 +OK and confirmation of who im logged in as, i also get the server name.
Any idea what im doing wrong?
James
I've written the following code to login to the server and list messages but it only outputs the +OK for authentication and nothing else any idea whats going on?
$fp = fsockopen("pop.phreaker.net", 110, $errno, $errstr);
if (!$fp) {
echo "ERROR: $errno - $errstr<br />\n";
} else {
fputs($fp, "USER username\x0D\x0A");
$buffer .= fread($fp, 4096);
fputs($fp, "PASS password\x0D\x0A");
$buffer .= fread($fp, 4096);
fputs($fp, "LIST\x0D\x0A");
$buffer .= fread($fp, 4096);
fclose($fp);
echo $buffer;
}
and the output is
+OK +OK +OK
and after glancing at the code its quite possible it is only displaying the data from the initial command and nothing else! when using the same code with a different pop server i do get 3 +OK and confirmation of who im logged in as, i also get the server name.
Any idea what im doing wrong?
James