A _php tutorial to implement POP3 mail with PHP

Source: Internet
Author: User
Introduction to the POP protocol (author: Chen Junqing October 18, 2000 11:53) This paper briefly describes the principle of receiving the decoding of mail and MIME messages through the POP3 protocol, and provides two useful PHP classes for the collection and MIME decoding, and provides a sample for use. It is divided into two parts: Mail charge and MIME decoding.      Here we first introduce you to the mail collection, decoding part will be in a future article for you detailed introduction, please pay attention. Now the largest application on the Internet should be non-email, we are accustomed to daily through the exchange of email, the major sites have also almost launched their own web-based free mail system. In this article, I will introduce some of the principles of e-mail implementation. At the same time, we assume that you have a certain basis for PHP programming, the TCP/IP protocol also has a certain understanding. Introduction to the POP protocol the full name of pop is the post office Protoco, the postoffice protocol, used for e-mail reception, which is now commonly used in the third edition, referred to as POP3. Through the POP protocol, after the client logs on to the server, can delete their own messages, or download to the local, after downloading, the e-mail client software can be local to the message to modify, delete, and so on.   Another message for receiving letters is the IMAP protocol, which is now developing quickly, and we will not discuss it in this article.   POP server is generally used TCP port 110th, if you are using Foxmail, in its mail, you can see its information prompt window has such a number of commands: "is connected to the 62.123.23.123:110";   "USER boss_ch";   "PASS ...";; ";";   Let's look at a transcript of a conversation with the POP3 server: Telenet pop.china.com +ok aimc Pop Service (mail2.china.com) is ready. User Boss_ch +ok Please enter password for user . PASS ****** +ok boss_ch has 1 messages (1 octets) STAT +ok 1 LIST +ok messages (1) TR 1 +ok octets received:from smtp2.ptt.js.cn ([202.102.24.37]) by china.com (JetMail 2.5.3.0) with SMTP ID jm483 9cc4227; Sat, Sep 05:31:21-0000 received:from chenjunqing ([61.155.120.6]) by smtp2.ptt.js.cn (Netscape Messaging Ser Ver 4.15) with SMTP ID g1brhj03. V07 for ; Sat, Sep 13:34:31 +0800 date:sat, Sep 13:34:18 +0800 from: =? Iso-8859-1? q?=b3=c2=bf=a1=c7=e5?= To:boss_ch@china.com Subject: =? Iso-8859-1? q?=d3=ca=bc=fe=ca=be=c0=fd?= X-mailer:foxmail 3.1 [cn] mime-version:1.0 Content-type:text/plain; charset= "GB2312" Content-transfer-encoding:8bit Message-id: Hello! This is a small example of a message QUIT +ok POP Server at Signing off. Here is a brief introduction to several commonly used POP3 commands: the command parameter status Description------------------------------------------USER username recognizes this command With the following pass command, if successful, it will result in a state transition PASS password recognized APOP name,digest recognition Digest is a MD5 message digest-------------------------------- ----------STAT None processes the request server to send back statistics about the mailbox, such as the total number of messages and the total number of bytes UIDL [msg#] handles the unique identifier of the returned message, and each identifier for the POP3 session will be the only LI ST [msg#] Processing returns the number of messages and the size of each message RETR [msg#] processing returns the entire text of the message identified by the parameter DELE [msg#] The processing server marks the message identified by the parameter as deleted by the Q    uit command execution RSET None processing server resets all messages marked for deletion to undo the dele command top [msg#] The processing server will return the first n rows of the message identified by the parameter, n must be a positive integer NOOP   None the processing server returns a positive response and does nothing. ------------------------------------------quit None Update exit

http://www.bkjia.com/PHPjc/531916.html www.bkjia.com true http://www.bkjia.com/PHPjc/531916.html techarticle Introduction to the POP protocol (author: Chen Junqing October 18, 2000 11:53) This paper briefly describes the principle of receiving the decoding of mail and MIME messages through the POP3 protocol; for collecting and mime decoding, providing ...

  • Related Article

    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.