On Fri, 27 Sep 2002 12:22:31 +0200, [EMAIL PROTECTED] (Margaret) wrote: >Hi > >I'm trying to get some examples for this module but cannot find any. Can >someone please send me a simple example. I want to extract the headers and >body of the messages and also be able to delete the messages.
Here is a simple example. Mboxtest is an mbox file. I don't think this module allows you to delete individual messages. Maybe you want POP3Client? If you want to do this on a remote pop server, try "poppy" Poppy will individually show the mail headers along with the message's size of each message on the mail server and then allow you to read, delete, reply, or perform other tasks on that message. http://home.sprynet.com/~cbagwell/projects.html #!/usr/bin/perl use Mail::MboxParser; my $mb = Mail::MboxParser->new('Mboxtest', decode => 'ALL'); # slurping for my $msg ($mb->get_messages) { print "###########################################################\n"; print $msg->header->{subject}, "\n"; print $msg->header->{from}, "\n"; print "###########################################################\n"; $msg->store_all_attachments('tmp'); my ($body) = $msg->body($msg->find_body,0); print ($body->as_string); print "###########################################################\n"; } print "############################################################\n"; print "############################################################\n"; print "############################################################\n"; # we forgot to do something with the messages $mb->rewind; while (my $msg = $mb->next_message) { # iterate again # ... } exit; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
