Use PHP to collect POP3 mails (1 ). This article briefly describes the principles of receiving and MIME mail through POP3 protocol. It provides two Practical PHP classes for receiving and MIME decoding, the sample POP protocol is introduced.
This article briefly describes the principles of receiving and MIME mail through POP3 protocol, provides two Practical PHP classes for receiving and MIME decoding, and provides samples for use. It is divided into two parts: email receiving and MIME decoding. Here we will first introduce you to the receipt of emails. the decoding section will be described in detail in future articles, so stay tuned.
Currently, the largest application on the Internet should be non-Email. every day, we are used to communicating via Email every day. almost all major websites have launched their own WEB-based free Email system. In this article, I will introduce some principles of Email implementation. At the same time, we assume that you have a certain foundation for PHP programming and a certain understanding of the TCP/IP protocol.
POP protocol introduction
POP stands for Post Office Protoco, which is the Post Office Protocol used for email reception. it is now commonly used in the third edition, POP3 for short. Through the POP protocol, after the client logs on to the server, it can delete its own emails, or download it to the local device. after the download, the email client software can modify and delete emails locally. The IMAP protocol is also used to receive emails, which is growing rapidly. we will not discuss this in this article.
POP servers generally use port 110 of TCP. if Foxmail is used, you can see the following command in the prompt window:
"Connecting to 62.123.23.123: 110 ";
"USER BOSS_CH ";
"PASS ..............";
Let's take a look at the transcript of a conversation with the POP3 server:
Telenet pop.china.com110
+ 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 (750 octets)
STAT
+ OK 1 750
LIST
+ OK 1 messages (750 octets)
1 750
RETR 1
+ OK 750 octets
Received: from smtp2.ptt.js.cn ([202.102.24.37]) by china.com (JetMail 2.5.3.0)
With SMTP id jm4839cc4227; Sat, 23 Sep 2000 05:31:21-0000
Received: from chenjunqing ([61.155.120.6]) by smtp2.ptt.js.cn
(Netscape Messaging Server 4.15) with SMTP id G1BRHJ03. V07
; Sat, 23 Sep 2000 13:34:31 + 0800
Date: Sat, 23 Sep 2000 13:34:18 + 0800
From: =? ISO-8859-1? Q? = B3 = C2 = BF = A1 = C7 = E5? =
Listen this article briefly describes the principles of receiving and MIME mail through POP3 protocol. for receiving and MIME decoding, two Practical PHP classes are provided and the samples are provided...