<small id='RNbya'></small><noframes id='RNbya'>

  • <legend id='RNbya'><style id='RNbya'><dir id='RNbya'><q id='RNbya'></q></dir></style></legend>

      1. <tfoot id='RNbya'></tfoot>
      2. <i id='RNbya'><tr id='RNbya'><dt id='RNbya'><q id='RNbya'><span id='RNbya'><b id='RNbya'><form id='RNbya'><ins id='RNbya'></ins><ul id='RNbya'></ul><sub id='RNbya'></sub></form><legend id='RNbya'></legend><bdo id='RNbya'><pre id='RNbya'><center id='RNbya'></center></pre></bdo></b><th id='RNbya'></th></span></q></dt></tr></i><div id='RNbya'><tfoot id='RNbya'></tfoot><dl id='RNbya'><fieldset id='RNbya'></fieldset></dl></div>
          <bdo id='RNbya'></bdo><ul id='RNbya'></ul>

        为什么此邮件消息不能正确解码?

        时间:2023-05-29

        <tfoot id='F0fRa'></tfoot>
            <bdo id='F0fRa'></bdo><ul id='F0fRa'></ul>
          • <legend id='F0fRa'><style id='F0fRa'><dir id='F0fRa'><q id='F0fRa'></q></dir></style></legend>
                  <tbody id='F0fRa'></tbody>
                  <i id='F0fRa'><tr id='F0fRa'><dt id='F0fRa'><q id='F0fRa'><span id='F0fRa'><b id='F0fRa'><form id='F0fRa'><ins id='F0fRa'></ins><ul id='F0fRa'></ul><sub id='F0fRa'></sub></form><legend id='F0fRa'></legend><bdo id='F0fRa'><pre id='F0fRa'><center id='F0fRa'></center></pre></bdo></b><th id='F0fRa'></th></span></q></dt></tr></i><div id='F0fRa'><tfoot id='F0fRa'></tfoot><dl id='F0fRa'><fieldset id='F0fRa'></fieldset></dl></div>

                  <small id='F0fRa'></small><noframes id='F0fRa'>

                  本文介绍了为什么此邮件消息不能正确解码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有这个代码.它来自 Zend 阅读邮件 示例.

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

                  $message = $mail->getMessage(1);
                  
                  // output first text/plain part
                  $foundPart = null;
                  foreach (new RecursiveIteratorIterator($mail->getMessage(1)) as $part) {
                      try {
                          if (strtok($part->contentType, ';') == 'text/plain') {
                              $foundPart = $part;
                              break;
                          }
                      } catch (Zend_Mail_Exception $e) {
                          // ignore
                      }
                  }
                  if (!$foundPart) {
                      echo 'no plain text part found';
                  } else {
                      echo $foundPart->getContent();
                  }
                  

                  我能得到的是消息,效果很好.但是试图将消息解码为可读的内容是行不通的.我试过 Zend_Mime、imap_mime 和 iconv 都没有运气.

                  What I can get is the message, that works fine. But trying to decode the message into something readable does not work. I have tried Zend_Mime, imap_mime and iconv with no luck.

                  这是我使用 $foundPart->getContent();

                  Hall=F3 heim=FAr

                  Hall=F3 heim=FAr

                  应该说Haló heimúr"

                  It should say "Halló heimúr"

                  我想要的只是一些图书馆,在那里我可以在实践中按下按钮,接收培根".我的意思是,我只想将库指向 POP3 邮箱,并以可读形式(没有任何编码问题)和附件获取电子邮件.

                  What I would want is just some library where i could "push button, receive bacon" in practice. What I mean is, I just want to point the library to a POP3 email box and get the email in readable form (without any encoding issues) and the attachments.

                  imap_mime_header_decode() 给我一个具有相同数据的数组.
                  iconv_ mime_ decode() 一样的

                  imap_mime_header_decode() Gives me an array with the same data.
                  iconv_ mime_ decode() Does the same

                  有没有人知道为什么会发生这种情况或者我可以将其抽象出来的某个库(PHP/Python 或 Perl)

                  Does anyone have any idea why this is happening or some library where I can just abstract this away (PHP/Python or Perl)

                  推荐答案

                  这可能是因为 base64 编码.Zend_Mail 文档说(在编码"下):

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

                  ...所有其他附件都已编码如果没有其他编码,则通过 base64在 addAttachment() 调用中给出或分配给 MIME 部件对象稍后.

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

                  尝试以下操作:

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

                  另外,请阅读:http://framework.zend.com/manual/en/zend.mail.encoding.html

                  希望以某种方式有所帮助.

                  Hope that helped somehow.

                  这篇关于为什么此邮件消息不能正确解码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:我应该如何在 ACL 中构建我的资源树? 下一篇:多复选框的 Zend 表单从标签中删除输入

                  相关文章

                    <tfoot id='hY4ZC'></tfoot>

                  1. <small id='hY4ZC'></small><noframes id='hY4ZC'>

                    <legend id='hY4ZC'><style id='hY4ZC'><dir id='hY4ZC'><q id='hY4ZC'></q></dir></style></legend>
                      • <bdo id='hY4ZC'></bdo><ul id='hY4ZC'></ul>
                      <i id='hY4ZC'><tr id='hY4ZC'><dt id='hY4ZC'><q id='hY4ZC'><span id='hY4ZC'><b id='hY4ZC'><form id='hY4ZC'><ins id='hY4ZC'></ins><ul id='hY4ZC'></ul><sub id='hY4ZC'></sub></form><legend id='hY4ZC'></legend><bdo id='hY4ZC'><pre id='hY4ZC'><center id='hY4ZC'></center></pre></bdo></b><th id='hY4ZC'></th></span></q></dt></tr></i><div id='hY4ZC'><tfoot id='hY4ZC'></tfoot><dl id='hY4ZC'><fieldset id='hY4ZC'></fieldset></dl></div>