Pop3 email receiving example _ PHP Tutorial

Source: Internet
Author: User
One pop3 mail is charged. Test_pop3.php (as the mainstream development language) HTMLHEADTITLETestforManuelLemossphp (as the mainstream development language) POP3classTITLEHEADBODY? Require (pop3.php (as test_pop3.php (as the mainstream development language)



Test for Manuel Lemoss php (as the mainstream development language) POP3 class


Require ("pop3.php (as the mainstream development language )");

$ 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 $messages messages in the mail box with a total of $size 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]),"
";

Http://www.bkjia.com/PHPjc/509051.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/509051.htmlTechArticletest_pop3.php (as the mainstream development language) html head TITLETest for Manuel Lemoss php (as the mainstream development language) POP3 class/TITLE/head body? Require ("pop3.php (...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.