Using PHP to collect POP3 emails 3_PHP tutorial

WBOY
Release: 2016-07-13 17:27:10
Original
788 people have browsed it

Application examples (Author: Chen Junqing, October 18, 2000 11:58) The class for receiving emails through POP3 has been introduced in detail in the previous article. Let’s take a look at how to apply this class:   include("pop3.inc.php");   $host="pop.china.com";   $user="boss_ch";   $pass="026007";   $rec=new pop3($host,110,2);   if (!$rec->open( )) die($rec->err_str); echo "open "; if (!$rec->login($user,$pass)) die($rec->err_str); echo "login"; if (!$ rec->stat()) die($rec->err_str); echo "Total ".$rec->messages." letters, total ".$rec->size."byte size
"; ($rec->messages>0)  {  if (!$rec->listmail()) die($rec->err_str);
mail_list);$i++) { "; }  $rec->getmail(1); echo "The content of the email header: "; for ($i=0;$i
head);$i++) echo htmlspecialchars($rec->head [$i])."
"; echo "Email text:

"; for ($i=0;$i
body);$i++) echo htmlspecialchars($rec->body[$i])."
"; }  $rec->close();  ?>  If you set debug in the pop3 class to true, you can also see how the program communicates with the pop3 server. For the program being debugged, like this It seems more intuitive. Summary From the above example, we can see that PHP is really a very powerful tool for website development, but we can also feel that PHP, as a hybrid language, is object-oriented. There are still many regrettable aspects in development compared with other tools such as Java. The implementation of this pop class also has many areas for improvement. Colleagues are welcome to provide guidance. Friends, please contact me: boss_ch@netease.com

http://www.bkjia.com/PHPjc/531906.html

truehttp: //www.bkjia.com/PHPjc/531906.htmlTechArticleApplication Example (Author: Chen Junqing, October 18, 2000 11:58) The class of POP3 receiving emails is in the previous The article has given you a detailed introduction, let’s take a look at how to apply this...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template