Hi all,
I am using IMAP PHP,I get(downloaded) the messages from the mail as well...But if the mail contains any attachments like PDF or HTML files it throws a encoded form of the attachment...I need to the the decoded form of the output...If any one is having a piece of code to resolve this problem...Please post that file that would be very useful for us...

Thanks in Advance...

Hello pritaeas

I have used base64_decode to read a PDF file but again it throws an unformatted file
also ia have tried $decodedstring=base64_decode(chunk_split($encodedstring)); it's not working i need to get a clear solution to get the decoded string

For example encoded PDF file like this:
ITloIOKTIdtmIYFTnroCtWDtmabf1Z7WmzpJAvBgY42QYemjk2s0BvgFRRfkrPTv4XTbF7vTyEGY
YrqojenQqsR+dsLelr0B8VUgXvWCMsWb6elVkHiiVIQKyncuTO9KYThuSL5sA30kA31LxA4fdvqu
QOxEkSFuVS2Z1jbAT66D8DxszkreCZhH6Yy3l0vLkA6LAF2ROg12VmYwmR5nF2WLQGjYAsuPd82K
NfsZcbOmGvAoSoLpHrh2NmIXF67MtbD7iHkd9YPssGeWzDEVQOa7jv37a1I7iDyuYEQeCryDm1c4
y5fa8BygkX+8Ke1xl2u6FBzOQHaTt8E5mRIt4Lq8FDPLIyNTdN5NN+prkvLBTONVGtkPiHSh9cWn
El4NkwkNS0rZFIQ8bfr2oUN9Rda478YVrk7rUa1k9e1ed3z8p17euRy5eoohhyXZrJW/SXk84cdT

After decoded the previous encoded file it shoes like this:
!9h â“!Ûf!Sžºµ`홦ßÕžÖ›:Ið`ca飓k4øEä¬ôïátÛ»ÓÈA˜bº¨éЪÄ~vÂÞ–½ñU ^õ‚2Å›ééUx¢T„
Êw.LïJa8nH¾l}$}KÄvú®@ìD‘!nU-™Ö6ÀO®ƒð<lÎJÞ ˜G錷—KË‹]‘:
vVf0™ge‹@hØËwÍŠ5ûq³¦ð(J‚é¸v6b®Ìµ°ûˆyõƒì°g–Ì1@滎ýûkR;ˆ<®`D
¼ƒ›W8Ë—Úð ‘¼)íq—kºÎ@v“·Á9™-ຼ3Ë##StÞM7êk’òÁLãUÙˆt¡õŧ^

KJÙ„<múö¡C}EÖ¸ïÆ®NëQ­dõí^w|ü§^Þ¹¹zŠ!‡%Ù¬•¿Iy<áÇS

Please give a solution to fix the problem....

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.