can anyone pls show me how to extract an attachment from an email message.
Printable View
can anyone pls show me how to extract an attachment from an email message.
lets see that you atleast tried it yourself, what have you got and we'll help you fix it.
welcome to the forums Kesmai
back to your response...i needed some professional help on how to do that(that's why i posted my problem).
because i don't know how to do it.
The e-mail is split up using content bondaries, extract the boundary information from the header and then split the message up using that. Do you know how e-mail messages are formatted?
thanks john
not at allQuote:
Originally Posted by john tindell
and also i can see the boundaries but how do i use it to split them
http://en.wikipedia.org/wiki/MIME
At the bottom there are also lots of useful links.
As for processing the message, you need to do string processing with PHP.
yeah i've read that before and i'm still trying to figure out what to do with the info on that page.
ok now, i think i've gotten to a part where i've been able to differentiate the message body from the attachment(its working fine) and also i've been able to decode the attachments(using base64_decode) and whats bothering me now is that, it'll only decode 2 of 4 attachments(i.e 1 .gif file, 1 .png file, 1 .rtf file and 1 .zip archive respectively).
so in a nutshell, it only decoded the .GIF and .PNG correctly while the 2 others where decoded badly(or wrongly).