Using PHP to implement POP3 message decoding a _php tutorial

Source: Internet
Author: User
Tags microsoft outlook
Preliminary understanding of the source file of the message (author: Chen Junqing October 24, 2000 15:08) 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 the examples used. It is divided into two parts: Mail charge and MIME decoding.   We have already introduced you to the Mail collection, now let us introduce you to the decoding Department of this article. In the previous article, we have completed an example of using PHP to receive mail through POP3, but in the use of this class, I believe you have seen, a lot of mail collected is a bunch of garbled, I do not understand! Yes.   Most of the current messages have been encoded, requiring a decoding process to become the text, images, or other attachments we are accustomed to. Source file for a message first, let's look at a simple message source file: (in Foxmail, select the message, click "View Source file" To see something like this) from: To:   Subject: =?gb2312?    b?xoo6w6oh?= Date:sun, 8 Oct 20:28:45 +0800 mime-version:1.0 content-type:multipart/alternative; boundary= "----=_nextpart_000_0007_01c03166.5b1e9510" X-priority:3 x-msmail-priority:normal x-mailer:microsoft out Look Express 5.00.2919.6700 x-mimeole:produced by Microsoft MimeOLE V5.00.2919.6700 This is a multi-part message in M   IME format.    ------=_nextpart_000_0007_01c03166.5b1e9510 Content-type:text/plain; charset= "gb2312" content-transfer-encoding:base64 w7vt0mlswuuwyao/dqo=------=_nextpart_000_0007_    01c03166.5b1e9510 content-type:text/html;   charset= "gb2312" content-transfer-encoding:base64   Pcfet0nuwvbfiehutuwgufvcteldicitly9xm0mvl0rurcbive1midqumcbucmfuc2l0aw9uywwv   L0voij4ncjxive1mpjxirufepg0kpe1fveegy29udgvudd0idgv4dc9odg1soybjagfyc2v0pwdi   mjmxmiigahr0cc1lcxvpdj1db250zw50lvr5cgu+dqo8tuvuqsbjb250zw50psjnu0hutuwgns4w mc4yotiwljaiig5hbwu9r0vorvjbve9spg0kpfnuwuxfpjwvu1rzteu+dqo8l0hfquq+dqo8qk9e WSBiZ0Nvbg9ypsnmzmzmzmy+dqo8relwpjxgt05uihnpemu9mj7du9pqwtlc67djo788l0zptlq+ pc9esvy+pc9ct0rzpjwvsfrntd4ncg==------=_ nextpart_000_0007_01c03166.5b1e9510-such a piece of mail, I think no one can read it.   Don't worry, let's take a closer look at the content. From: to: This is a good understanding, the message sent by boy@netease.com, the recipient is boss_ch@china.com, the meaning of these tags we basically can understand literally To, like Date:sun, 8 Oct 2000 20:28:45 +0800 represents the time, X-priority:3 represents the priority of the message, X-mailer:microsoft Outlook Express 5.00.2919.6700 is the name of the mail sender, which is used in Outllook 5, but these things have nothing to do with the content of the email. We don't need to delve into it.

http://www.bkjia.com/phpjc/531927.html www.bkjia.com true http://www.bkjia.com/phpjc/531927.html techarticle preliminary understanding of the source file of the message (author: Chen Junqing October 24, 2000 15:08) This article briefly describes the use of the POP3 protocol to receive mail, The decoding principle of MIME messages; for collection and mi ...

  • 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.