Mohanty, Debi (MED, TCS) wrote:
Hi,
Please suggest me how to detach the attachments (Read the
attachments) from a mail message using the IMAP client in perl.

Please help me on this ....

Thanks&Regards
Debi
{snip}

I installed the 'mime-tools' bundle from cpan... (win 98, active 633)... MIME-tools-5.411a.tar.gz, and it worked well. The examples containg 'mimeexplode', a script that works as follows, (with bits saved right from my 'sent' and 'todo' folders).

I've interspersed my comments.

C:\WINDOWS\Desktop\examples>perl mimeexplode message.eml
Message: msg2 (message.eml)
Part: msg2\msg-570013-1.txt (text/plain)
Part: msg2\Brooklyn_and_NYC.txt (text/plain)

C:\WINDOWS\Desktop\examples>perl mimeexplode message2.eml
Message: msg3 (message2.eml)
Part: msg3\msg-545329-1.txt (text/plain)
Part: msg3\shep_nuland_list_fixz.csv (text/plain)

C:\WINDOWS\Desktop\examples>perl mimeexplode message3.eml
Message: msg4 (message3.eml)
Part: msg4\msg-545329-1.txt (text/plain)
Part: msg4\dear_founder_merged.doc (application/msword)

C:\WINDOWS\Desktop\examples>perl mimeexplode message4.eml
Message: msg5 (message4.eml)
couldn't open message4.eml at mimeexplode line 113.

<<<< made an empty folder... >>>>

C:\WINDOWS\Desktop\examples>perl mimeexplode message4.eml
Message: msg6 (message4.eml)
Part: msg6\msg-545329-1.txt (text/plain)
Part: msg6\contract.pdf (application/pdf)

C:\WINDOWS\Desktop\examples>perl mimeexplode message5.eml
Message: msg7 (message5.eml)
Part: msg7\msg-545329-1.txt (text/plain)
Part: msg7\Clipboard.jpg (image/jpeg)

C:\WINDOWS\Desktop\examples>perl mimeexplode message6.eml
Message: msg8 (message6.eml)
Part: msg8\msg-545329-1.txt (text/plain)
Part: msg8\msg-545329-2.txt (text/plain)
Part: msg8\Myrasm6.jpg (application/mac-binhex40)

<<<<< oops. not prepared to handle it. BUT... >>>>
<<<< C:\WINDOWS\Desktop\examples\msg8>ren myrasm6.jpg myrasm.bin.hqx >>
<<<< and it worked nicely... >>>>

C:\WINDOWS\Desktop\examples>perl mimeexplode message7.eml
Message: msg9 (message7.eml)
Part: msg9\msg-545329-1.txt (text/plain)
Part: msg9\msg-545329-2.txt (text/plain)
Part: msg9\KDP2002.tif_1 (image/tiff)

<<<< didn't work -- another mac file?? also quite large ;-(>>>>

C:\WINDOWS\Desktop\examples>perl mimeexplode message8.eml
Message: msg10 (message8.eml)
Part: msg10\msg-545329-1.txt (text/plain)
Part: msg10\msg-545329-2.txt (text/plain)

The others all worked as expected. ;-)


-- Mike Higgins


^ ^
<-|->
(.)__ the world is a big box of paints.
__ __ and others, the canvas we're dealt.
| | - XTC
_/ \_

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Reply via email to