in reply to Saving all email attachments into various files.

MIME::Parser can do all of that for you. It's parse() method will automatically break apart the message and save the bits in separate files.

#!/usr/bin/perl use MIME::Parser; my $p = MIME::Parser->new; $p->output_dir( "/Users/brian/Desktop" ); $p->parse( \*STDIN );

If you want the whole message, read it and store it in a variable then use the parse_data() method instead.

I have a full program in my "Detaching attachments" article in the September 2004 issue of The Perl Journal.

--
brian d foy <bdfoy@cpan.org>

Replies are listed 'Best First'.
Re^2: Saving all email attachments into various files.
by chanakya (Friar) on Jan 09, 2005 at 13:19 UTC
    Brian,

    Thanks for your suggestion. I'm going to use parse_data() method and will try to break the attachments.

    Currently I don't have the September issue of TPJ
    .