ZF-7142: Get e-mail structure

Description

Hello!

There is a PHP function "imap_fetchstructure" that tells the transfer encoding of the message (for example "BASE64" or "QUOTED-PRINTABLE"). Currently it seems that Zend framework cannot give this information. But it is important for the very simple case when I just need to list all the e-mails and display their content. Non-ASCII characters are encoded in the content returned by function "getContent" — I cannot display the message in such state to the users. :(

Thanks!

Comments

The messages returned by Zend_Mail_Storage implements RecursiveIterator. If you need to flatten the structure use RecursiveIteratorIterator. In every returned part you can use the same methods to get the headers and body of the part. See the docs and the demo for examples.

Thank you for the comment! The transfer encoding is indeed obtainable with $oMessage->contentTransferEncoding or $oMessagePart->contentTransferEncoding.