Why doesn't this mail message decode correctly?

后端 未结 2 417

I have this code. It\'s from the Zend Reading Mail example.

$message = $mail->getMessage(1);

// output first text/plain part
$foundPart = null;
foreach (         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-06 10:50

    This could be because of base64 encoding. The Zend_Mail docs say (under 'encoding'):

    ...All other attachments are encoded via base64 if no other encoding is given in the addAttachment() call or assigned to the MIME part object later.

    Try something like:

    echo base64_decode($foundPart->getContent());
    

    Also, read: http://framework.zend.com/manual/en/zend.mail.encoding.html

    Hope that helped somehow.

提交回复
热议问题