ProgramIT has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use Mail::POP3Client; use Email::MIME; use Tie::File; use Email::MIME::Attachment::Stripper; my $pop_user = "user@server.com"; my $pop_pass = "password"; my $pop_server = "pop.server.com"; $pop = new Mail::POP3Client( USER => $pop_user, PASSWORD => $pop_pass, HOST => $pop_server, AUTH_MODE => 'PASS'); $message = $pop->Body(1); my $parser = Email::MIME->new($message); my @parts = $parser->parts; print @parts[1]; $stripper = Email::MIME::Attachment::Stripper->new(@parts[1]); my @attachments = $stripper->attachments; print @attachments[0]; $pop->Close();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting Attachment from Email
by zwon (Abbot) on Jan 14, 2010 at 18:58 UTC |