Zend Framework: How to read email attachments (and save to disk)?
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 开发者_C百科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?
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/
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.
精彩评论