email attachement
- From: tony.marquis@xxxxxxxxx (Tony Marquis)
- Date: Thu, 21 Feb 2008 10:52:11 -0500
Hi all,
I'm trying to save attachment from emails with a specific subject. but i can't find the right module...
thank you for your help.
My script :
# Duh
use Net::IMAP::Simple;
use Email::Simple;
# Create the object
my $imap = Net::IMAP::Simple->new('xxx.xxx.xxx.xxx') ||
die "Unable to connect to IMAP: $Net::IMAP::Simple::errstr\n";
# Log on
if(!$imap->login('xxx@xxxxxx','xxxxx')){
print STDERR "Login failed: " . $imap->errstr . "\n";
exit(64);
}
my $nm = $imap->select('INBOX');
for(my $i = 1; $i <= $nm; $i++){
my $test_sub = Email::Simple->new(join '', @{ $imap->top($i) } );
my $subject = substr($test_sub->header('Subject'),0,25);
if($subject=="xxxxxxxxxxxxxxxxxxxxxxxxx"){
my $es = $imap->get($i);
##################################################################
# I want to use @{$es} and extract all attachment from it and save them somewhere # ##################################################################
}
}
$imap->quit;
.
- Prev by Date: Re: GUI Toolkit - which one to learn? (GTK/GTK2/Tk)
- Next by Date: Re: GUI Toolkit - which one to learn? (GTK/GTK2/Tk)
- Previous by thread: Using perl variable in command line
- Next by thread: Re: email attachement
- Index(es):
Relevant Pages
|