PHP MIME Mail decoder class 2008.01.03 (Default branch)


 
Thread Tools Search this Thread
Special Forums News, Links, Events and Announcements Software Releases - RSS News PHP MIME Mail decoder class 2008.01.03 (Default branch)
# 1  
Old 01-03-2008
PHP MIME Mail decoder class 2008.01.03 (Default branch)

Image PHP MIME Mail decoder class is a PHP class to parse and decode MIME email messages. It supports decoding single RFC 2822 MIME messages or archives that aggregate multiple messages in the mbox format. It can decode messages read from files or data strings. The bodies of multipart messages can be decoded into distinct sub-messages. Optionally, the message body data can be saved to separate files, so the class can handle messages larger than the available memory. The parser can tolerate some syntax errors in malformed messages that are not compliant with RFC 2822. License: BSD License (revised) Changes:
This release includes an auxiliary class that can parse and extract e-mail addresses from message headers that usually contain addresses like From:, To:, Cc:, and Bcc: .Image

More...
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question
Encode::MIME::Header(3pm)				User Contributed Perl Documentation				 Encode::MIME::Header(3pm)

NAME
Encode::MIME::Header -- MIME 'B' and 'Q' header encoding SYNOPSIS
use Encode qw/encode decode/; $utf8 = decode('MIME-Header', $header); $header = encode('MIME-Header', $utf8); ABSTRACT
This module implements RFC 2047 Mime Header Encoding. There are 3 variant encoding names; "MIME-Header", "MIME-B" and "MIME-Q". The difference is described below decode() encode() ---------------------------------------------- MIME-Header Both B and Q =?UTF-8?B?....?= MIME-B B only; Q croaks =?UTF-8?B?....?= MIME-Q Q only; B croaks =?UTF-8?Q?....?= DESCRIPTION
When you decode(=?encoding?X?ENCODED WORD?=), ENCODED WORD is extracted and decoded for X encoding (B for Base64, Q for Quoted-Printable). Then the decoded chunk is fed to decode(encoding). So long as encoding is supported by Encode, any source encoding is fine. When you encode, it just encodes UTF-8 string with X encoding then quoted with =?UTF-8?X?....?= . The parts that RFC 2047 forbids to encode are left as is and long lines are folded within 76 bytes per line. BUGS
It would be nice to support encoding to non-UTF8, such as =?ISO-2022-JP? and =?ISO-8859-1?= but that makes the implementation too complicated. These days major mail agents all support =?UTF-8? so I think it is just good enough. Due to popular demand, 'MIME-Header-ISO_2022_JP' was introduced by Makamaka. Thre are still too many MUAs especially cellular phone handsets which does not grok UTF-8. SEE ALSO
Encode RFC 2047, <http://www.faqs.org/rfcs/rfc2047.html> and many other locations. perl v5.14.2 2011-08-09 Encode::MIME::Header(3pm)