Jump to content


Photo

download pop attachements using imap_body


  • Please log in to reply
1 reply to this topic

#1 warnockm

warnockm
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 29 April 2006 - 11:29 PM

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

#2 radox

radox
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 30 April 2006 - 04:54 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users