http://www.perlmonks.org?node_id=470197


in reply to Gmailize your mbox

This is a very handy snippet.

I've modified it ever so slightly:

#!/usr/bin/perl use strict; use Email::Folder; use Mail::Mailer; my $email = '@gmail.com'; my $tag = 'Mail Tag'; my $folder = Email::Folder->new($ARGV[0] || die "No mbox supplied\n\nU +sage: $0 mboxname\n"); foreach ($folder->messages){ print $_->header("Subject").$/; my $mailer = new Mail::Mailer; $mailer->open({ To => $email, From => $_->header("From"), Subject => "$tag " . $_->header("Subject"), }); print $mailer $_->body; $mailer->close; print "Email with Subject: " . $_->header("Subject") . " sent\n"; }

Thanks a lot!

Gavin.

Walking the road to enlightenment... I found a penguin and a camel on the way.....
Fancy a yourname@perl.me.uk? Just ask!!!