Jump to content

Archived

This topic is now archived and is closed to further replies.

warnockm

download pop attachements using imap_body

Recommended Posts

I writing some php code to check my email and download the attachements. I'm using a pop account and using the imap() functions built into php. I am able to check my mail and see the encoded attachment in the body using imap_body(), however, i'm not sure what to do with it! DOes anyone know of example code or a plugin to deal w/ downloading attachements? the body looks like this:

This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C6687A.001D3210 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ------=_NextPart_000_0001_01C6687A.001D3210 Content-Type: image/jpeg; name="ATT00001.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ATT00001.jpg" /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkz

....

I'd like to get the Content-Type, filename and content-transfer-encoding, as well as the contents out of the email. thanks

Share this post


Link to post
Share on other sites
i think this link will help you get started.

[a href=\"http://www.linuxscope.net/articles/mailAttachmentsPHP.html\" target=\"_blank\"]http://www.linuxscope.net/articles/mailAttachmentsPHP.html[/a]

i needed to customize the encoding....good luck.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.