Zend Mail 和编码、内容传输等 - 统一吗?
Zend Framework 中是否有任何类可以让我轻松阅读电子邮件?
Zend_Mail 类确实允许我轻松获取标题、主题和内容正文。但是将所有内容转换为 UTF-8 和人类可读的格式仍然是一件痛苦的事情。
或者我做错了什么?据我所知,Zend Framework 不允许我轻松获取我可以使用的 UTF-8 字符串,我仍然需要进行一些后处理。正确的?
Is there any class in the Zend Framework that allows me to easily read emails?
The Zend_Mail class does allow me to easy get headers, subject and the content body. But transferring everything to UTF-8 and human-readable format is still a pain.
Or am I doing something wrong? As far as I can tell, Zend Framework does not allow me to easily get UTF-8 strings that I can just use, I still have to do some post-processing. Right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关键是您需要迭代消息中的各个部分并找到文本。一旦获得它,您就可以使用
quoted_printable_decode
以有用的方式获取文本本身。这是一些粗略且现成的代码,使用 Zend_Mail 读取 IMAP 电子邮件信箱:
The key thing is that you need to iterate over the parts within the Message and find the text. Once you have it, then you can use
quoted_printable_decode
to get the text itself in a useful way.This is some rough and ready code that reads IMAP email boxes with Zend_Mail: