当前位置: 首页>>代码示例>>PHP>>正文


PHP Mail_mimeDecode::_quotedPrintableDecode方法代码示例

本文整理汇总了PHP中Mail_mimeDecode::_quotedPrintableDecode方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail_mimeDecode::_quotedPrintableDecode方法的具体用法?PHP Mail_mimeDecode::_quotedPrintableDecode怎么用?PHP Mail_mimeDecode::_quotedPrintableDecode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mail_mimeDecode的用法示例。


在下文中一共展示了Mail_mimeDecode::_quotedPrintableDecode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetMessage


//.........这里部分代码省略.........
                 }
                 if ($output->airsyncbasenativebodytype == 2) {
                     $this->getBodyRecursive($message, "plain", $plain);
                     if ($plain == "") {
                         $this->getBodyRecursive($message, "html", $plain);
                         // remove css-style tags
                         $plain = preg_replace("/<style.*?<\\/style>/is", "", $plain);
                         // remove all other html
                         $plain = preg_replace("/<br.*>/is", "<br>", $plain);
                         $plain = preg_replace("/<br >/is", "<br>", $plain);
                         $plain = preg_replace("/<br\\/>/is", "<br>", $plain);
                         $plain = str_replace("<br>", "\r\n", $plain);
                         $plain = strip_tags($plain);
                     }
                     $mimemsg->setTXTBody(str_replace("\n", "\r\n", str_replace("\r", "", w2u($plain))));
                     $this->getBodyRecursive($message, "html", $html);
                     $mimemsg->setHTMLBody(str_replace("\n", "\r\n", str_replace("\r", "", w2u($html))));
                 }
                 if (!isset($output->airsyncbasebody->data)) {
                     $output->airsyncbasebody->data = $body . $mimemsg->txtheaders() . "\n\n" . $mimemsg->get();
                 }
                 $output->airsyncbasebody->estimateddatasize = byte_strlen($output->airsyncbasebody->data);
             } else {
                 if (isset($bodypreference[2])) {
                     debugLog("HTML Body");
                     // Send HTML if requested and native type was html
                     $output->airsyncbasebody->type = 2;
                     $this->getBodyRecursive($message, "plain", $plain);
                     $this->getBodyRecursive($message, "html", $html);
                     if ($html == "") {
                         $this->getBodyRecursive($message, "plain", $html);
                     }
                     if ($html == "" && $plain == "" && byte_strlen($mobj->_body) > 0) {
                         $plain = $html = $mobj->_quotedPrintableDecode($mobj->_body);
                     }
                     if ($output->airsyncbasenativebodytype == 2) {
                         $html = w2u($html);
                     } else {
                         $html = '<html>' . '<head>' . '<meta name="Generator" content="Z-Push">' . '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '</head>' . '<body>' . str_replace("\n", "<BR>", str_replace("\r", "<BR>", str_replace("\r\n", "<BR>", w2u($plain)))) . '</body>' . '</html>';
                     }
                     if (isset($bodypreference[2]["TruncationSize"]) && strlen($html) > $bodypreference[2]["TruncationSize"]) {
                         $html = utf8_truncate($html, $bodypreference[2]["TruncationSize"]);
                         $output->airsyncbasebody->truncated = 1;
                     }
                     $output->airsyncbasebody->data = $html;
                     $output->airsyncbasebody->estimateddatasize = byte_strlen($html);
                 } else {
                     // Send Plaintext as Fallback or if original body is plaintext
                     debugLog("Plaintext Body");
                     $plain = $this->getBody($message);
                     $plain = w2u(str_replace("\n", "\r\n", str_replace("\r", "", $plain)));
                     $output->airsyncbasebody->type = 1;
                     if (isset($bodypreference[1]["TruncationSize"]) && strlen($plain) > $bodypreference[1]["TruncationSize"]) {
                         $plain = utf8_truncate($plain, $bodypreference[1]["TruncationSize"]);
                         $output->airsyncbasebody->truncated = 1;
                     }
                     $output->airsyncbasebody->estimateddatasize = byte_strlen($plain);
                     $output->airsyncbasebody->data = $plain;
                 }
             }
             // In case we have nothing for the body, send at least a blank...
             // dw2412 but only in case the body is not rtf!
             if ($output->airsyncbasebody->type != 3 && (!isset($output->airsyncbasebody->data) || byte_strlen($output->airsyncbasebody->data) == 0)) {
                 $output->airsyncbasebody->data = " ";
             }
         }
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:67,代码来源:imap.php


注:本文中的Mail_mimeDecode::_quotedPrintableDecode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。