如何使用 PHP 从电子邮件数据中提取 html 编码

发布于 2024-09-27 07:22:38 字数 379 浏览 2 评论 0原文

我正在处理电子邮件并希望在浏览器中显示 html,我不知道如何处理编码。我想提取 html 以在 html 浏览器中显示它。我计划这样做的方法是在整个电子邮件上使用 html 解析器来解析 html 部分中标签之间的数据。有没有更简单/更有效的方法来做到这一点?

这是文本编码

------=_Part_29856965_540743623.1285814590176 内容类型:文本/纯文本;字符集=ISO-8859-1 Content-Transfer-Encoding: 7bit

这是html编码

------=_Part_29856965_540743623.1285814590176 内容类型:text/html;字符集=ISO-8859-1 内容传输编码:7bit

I'm working with emails and want to display the html in the browser, I'm not sure how to deal with the encoding. I want to extract the html to display it in the html browser. The way I plan on doing this is using an html parser on the entire email parsing the data inbetween the tags in the html section. Is there an easier/more efficient way to do this?

Here's text encoding

------=_Part_29856965_540743623.1285814590176
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Here's the html encoding

------=_Part_29856965_540743623.1285814590176
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

锦爱 2024-10-04 07:22:38

您可以查看 ezComponents - Mail 组件。它有很多用于构建和使用 MIME 的操作

http://ezcomponents.org/docs/tutorials/Mail

You can have a look at the ezComponents - Mail component. It has a lot of operations for building and using a MIME

http://ezcomponents.org/docs/tutorials/Mail

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文