use strict; use Mail::POP3Client; use Email::MIME; use Email::MIME::Attachment::Stripper; my $pop = new Mail::POP3Client( USER => 'xxx', PASSWORD => "xxx", HOST => "pop.googlemail.com", USESSL => 'true', ); print "Status: ". $pop->State()." No of email:". $pop->Count(); if ($pop->Count()) { my $mail=$pop->HeadAndBody(1); my $parsed = Email::MIME->new($mail);# my $stripper = Email::MIME::Attachment::Stripper->new($parsed); my @attachments = $stripper->attachments; print; } $pop->Close(); exit;