I used the Imap / POP3 PHP library along with fragments from the Horde project to parse attachments. Horde provides some useful classes for handling MIME encodings.
I downloaded the entire Horde stack and used separate classes in my application.
source
share