【 tulaoshi.com - PHP 】
test_pop3.php
<HTML
<HEAD
<TITLETest for Manuel Lemos's PHP POP3 class</TITLE
</HEAD
<BODY
<?
require("pop3.php");
$user="user";
$password="passwd";
$apop=0;
$pop3_connection=new pop3_class;
$pop3_connection-hostname="mail.xiaocui.com";
if(($error=$pop3_connection-Open())=="")
{
echo "<PREConnected to the POP3 server "$pop3_connection-hostname".</PREn";
if(($error=$pop3_connection-Login($user,$password,$apop))=="")
{
echo "<PREUser "$user" logged in.</PREn";
if(($error=$pop3_connection-Statistics(&$messages,&$size))=="")
{
echo "<PREThere are <b$messages</b messages in the mail box with a total of <b$size</b bytes.</PREn";
$result=$pop3_connection-ListMessages("",0);
if(GetType($result)=="array")
{
for(Reset($result),$message=0;$message<count($result);Next($result),$message++)
echo "<PREMessage ",Key($result)," - ",$result[Key($result)]," bytes.</PREn";
if($messages0)
{
if(($error=$pop3_connection-RetrieveMessage(1,&$headers,&$body,-1))=="")
{
echo "<PREMessage 1:n---Message headers starts below---</PREn";
for($line=0;$line<count($headers);$line++)
echo "<PRE",HtmlSpecialChars($headers[$line]),"</PREn";
echo "<PRE---Message headers ends above---n---Message body starts below---</PREn";
for($line=0;$line<count($body);$line++)
echo "<PRE",HtmlSpecialChars($body[$line]),"</PREn";
echo "<PRE---Message body ends above---</PREn";
}
}
&nbs