从原始正文解析邮件的最佳 PHP 类?

发布于 2024-12-11 07:50:40 字数 531 浏览 2 评论 0原文

作为来源,我有由原始电子邮件组成的变量,带有标题和正文:

From: Guy <mail>
Subject: Stuff
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
X-etc: etc etc etc

This is the raw body.
(body in some cases also contains quoted printable encoding, attachments, base64, etc etc)

我重复一遍:我将其作为变量中的文本,如果没有,我会使用 imap_fetchbody (这需要远程邮箱才能工作,无法获取原始输入)

我还发现这个库似乎相当完整: http://pear.php.net/package/Mail_mimeDecode

我可以使用的最好的课程是什么?

As sources, i have variables composed by the raw email, with headers and body:

From: Guy <mail>
Subject: Stuff
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
X-etc: etc etc etc

This is the raw body.
(body in some cases also contains quoted printable encoding, attachments, base64, etc etc)

I repeat it: i have this as text in variables, if not i would use imap_fetchbody (that requires a remote mailbox to work, can't get raw inputs)

I also found this library that seems to be quite complete: http://pear.php.net/package/Mail_mimeDecode

What is the best class i can use?

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

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

发布评论

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

评论(1

淡淡の花香 2024-12-18 07:50:40

mailparse 如果你为 php 安装了它,它会非常高效,因为它不保留在内存中的消息。

mailparse if you get it installed for php is very efficient because it does not keep in memory messages.

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