Home > php教程 > php手册 > body text

pop3邮件收取一例

WBOY
Release: 2016-06-13 10:31:05
Original
792 people have browsed it

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".
Copy after login
";
   if(($error=$pop3_connection->Login($user,$password,$apop))=="")
   {
      echo "
User "$user" logged in.
Copy after login
";
      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.
Copy after login
";
         $result=$pop3_connection->ListMessages("",0);
         if(GetType($result)=="array")
         {
            for(Reset($result),$message=0;$message               echo "
Message ",Key($result)," - ",$result[Key($result)]," bytes.
Copy after login
";
             if($messages>0)
            {
                if(($error=$pop3_connection->RetrieveMessage(1,&$headers,&$body,-1))=="")
                {
                  echo "
Message 1:
---Message headers starts below---
Copy after login
";
                  for($line=0;$line                     echo "
",HtmlSpecialChars($headers[$line]),"
Copy after login
";
                  echo "
---Message headers ends above---
---Message body starts below---
Copy after login
";
                  for($line=0;$line                     echo "
",HtmlSpecialChars($body[$line]),"
Copy after login
";
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!