【问题标题】:I can't decode gmail html message when i use imap (PHP)当我使用 imap (PHP) 时,我无法解码 gmail html 消息
【发布时间】:2018-03-02 15:06:11
【问题描述】:

我是一名新手开发人员,我在自己的 PHP 应用程序上使用 imap 和 gmail

问题,当我尝试解码 gmail html 消息(特别是 google+/linkedin)。它以原始(编码)格式显示。 我想以标准格式显示它,因为它显示在 GMAIL 上。

例如:

GMAIL 上的原始消息: Image (click here)

关于我的应用程序的消息: Image (Click here)

最好的问候,

【问题讨论】:

    标签: php gmail imap gmail-imap gmail-pop


    【解决方案1】:

    这看起来像 base64 编码。所以解码吧!

    $hopefullyTheHtml = base64_decode($string);

    http://php.net/manual/en/function.base64-decode.php

    【讨论】:

    • 谢谢你的回复,当我使用base64_decode时,消息被解码为文本格式,很好但我想得到html格式。
    • 当我使用“imap_fetchstructure”时,它返回对应于“Quoted-Printable”的传输编码值=“4”。 php.net/manual/en/function.imap-fetchstructure.php "Quoted-Printable" 仅适用于简单消息,但不适用于从 Google+ 收到的消息。
    猜你喜欢
    • 2013-03-10
    • 1970-01-01
    • 2012-01-02
    • 2016-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-02
    相关资源
    最近更新 更多