#!/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();
In reply to Extracting Attachment from Email by ProgramIT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |