首頁  >  文章  >  php教程  >  pop3邮件收取一例

pop3邮件收取一例

WBOY
WBOY原創
2016-06-13 10:31:05787瀏覽

test_pop3.php(做为现在的主流开发语言)



Test for Manuel Lemoss php<font class="reblank">(做为现在的主流开发语言)</font> POP3 class



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 "
Connected to the POP3 server "$pop3_connection->hostname".
";
   if(($error=$pop3_connection->Login($user,$password,$apop))=="")
   {
      echo "
User "$user" logged in.
";
      if(($error=$pop3_connection->Statistics(&$messages,&$size))=="")
      {
         echo "
There are <b>$messages</b> messages in the mail box with a total of <b>$size</b> bytes.
";
         $result=$pop3_connection->ListMessages("",0);
         if(GetType($result)=="array")
         {
            for(Reset($result),$message=0;$message               echo "
Message ",Key($result)," - ",$result[Key($result)]," bytes.
";
             if($messages>0)
            {
                if(($error=$pop3_connection->RetrieveMessage(1,&$headers,&$body,-1))=="")
                {
                  echo "
Message 1:
---Message headers starts below---
";
                  for($line=0;$line                     echo "
",HtmlSpecialChars($headers[$line]),"
";
                  echo "
---Message headers ends above---
---Message body starts below---
";
                  for($line=0;$line                     echo "
",HtmlSpecialChars($body[$line]),"
";
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn