【发布时间】:2014-03-13 18:05:16
【问题描述】:
我想在 PHP 中使用 IMAP 协议获取电子邮件的 html 正文。
我使用了 IMAP 模块的 imap_fetchbody() 功能,但没有收到电子邮件的 html 正文。
有可能吗?
如果可能的话,使用哪个函数或代码?
【问题讨论】:
标签: php gmail-imap
我想在 PHP 中使用 IMAP 协议获取电子邮件的 html 正文。
我使用了 IMAP 模块的 imap_fetchbody() 功能,但没有收到电子邮件的 html 正文。
有可能吗?
如果可能的话,使用哪个函数或代码?
【问题讨论】:
标签: php gmail-imap
如果您可以控制自己的服务器,请安装并使用 PEAR 包。 他们非常擅长打开和编辑 IMAP 和 mbox 等邮件格式
【讨论】:
如果你想在 html 中获取邮件正文,
$html_message = imap_fetchbody($inbox,$email_number, "1.2");
// NOTE: "1.2" here is a string and not an integer.
详情:
()Root Message Part (multipart/related)
(1) The text parts of the message (multipart/alternative)
(1.1) Plain text version (text/plain)
(1.2) HTML version (text/html)
(2) The background stationary (image/gif)
【讨论】: