Zend Framework:如何读取电子邮件附件(并保存到磁盘)?
我目前正在使用 Zend_Mail_Storage_Imap 来使用 IMAP 读取电子邮件。感谢文档,我能够阅读电子邮件正文(文本和 html)。
现在我想弄清楚如何保存电子邮件附件。我找不到任何解释如何转换原始内容并保存附件的内容。我该怎么做?
I am currently using Zend_Mail_Storage_Imap to read email messages using IMAP. I am able to read the email body (text and html) thanks to the documentation.
Now I'm trying to figure out how to save email attachments. I can't find anything that explains how to convert the raw content and save the attachments. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试这些:
http://macfoo .wordpress.com/2009/06/10/save-an-email-attachment-using-zend-mail/
http://www.electrictoolbox.com/function-extract-email-attachments- php-imap/
Try these:
http://macfoo.wordpress.com/2009/06/10/save-an-email-attachment-using-zend-mail/
http://www.electrictoolbox.com/function-extract-email-attachments-php-imap/
我发现使用 Zend_Mail 阅读电子邮件可能有点问题。有时,并非所有附件文件都能被识别,或者在某些情况下 imap 甚至无法解码电子邮件正文。
我们现在使用 Sendgrid 服务 来解析电子邮件,并且运行良好。他们有一个特殊的 API 来解码电子邮件。缺点是要花钱,但我更喜欢更好的结果。
I found that reading emails using Zend_Mail can be a little buggy. Sometimes not all of the attachment files are recognized or in some cases imap can't even decode the body of the email .
We're using Sendgrid service to parse emails now, and it's working pretty well. They have a special api to decode emails. on the downside, it cost money, but I prefer better results.