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.
|
|---|
| 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 |