in reply to Re: Error in Net::POP3
in thread Error in Net::POP3

I'm pretty new at Perl email and Object Oriented Perl but I'm not seeing how to save an attached XLS file from a POP3 message. So that's probably why I didn't use Mail::Box::POP3, as I can't find many good coding examples of saving an attachment.

A Google search did not give me many complete examples. If you have a more complete example I'd appreciate a link to it.

Perl 5.8.8 on Redhat Linux RHEL 5.5.56 (64-bit)

Replies are listed 'Best First'.
Re^3: Error in Net::POP3
by AppleFritter (Vicar) on Jul 09, 2014 at 18:16 UTC

    Disclaimer: I don't have any setup for testing any of this with, but here's some skeleton code:

    use Mail::Box::POP3; my $folder = Mail::Box::POP3->new(folder => $ENV{MAIL}, ...); my $message = $folder->message(0); if($message->body->isMultipart) { foreach my $part ($message->body->parts) { my $attached_body = $part->decoded; ... } }

    This is based on pieces of code found throughout the (admittedly ascetic) Mail::Box documention.