Jump to content

download pop attachements using imap_body


warnockm

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
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.