Extract attachments from MIME or 822 format messages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AdamAtlas
Forum Newbie
Posts: 3
Joined: Fri Nov 29, 2002 4:19 pm
Location: /dev/null

Extract attachments from MIME or 822 format messages

Post by AdamAtlas »

I need some PHP code or a class that can take a MIME or RFC822 formatted email message, and extract and return any image attachments and their corresponding filenames. Is there any code that will do this? Or can anyone give me information on how I'd code one? (Remember, I need to get access to the actual image data and encoding information, in addition to the filename.)

Thanks,

Adam Atlas
Galahad
Forum Contributor
Posts: 111
Joined: Fri Jun 14, 2002 5:50 pm

Post by Galahad »

Look at this page. I used that for a little while. The author (Richard Heyes) states that using built-in php extensions (such as mailparse or the imap functions) are faster. However, when I used his script, I didn't have control over the configuration of my server, so it worked out fine. I think that the imap functions are the best way to go, but they require an additional library. The manual covers that more. Note that, as the manual points out, the imap functions can use pop3 and nntp, not just imap. Hope that helps, good luck.
Post Reply