in reply to Mimetools

As your title implies, MIME-tools will help with getting the information out of the email once you have received it. You will need to get your hands on the email first, of course. If your mail lives on a POP3 server, use Net::POP3 to get it.

I will now assume that your mail is sitting in a text file named incoming.

#!/usr/bin/perl -w use strict; use MIME::Parser; my $parser=new MIME::Parser; $parser->output_dir("mime"); open FILE, "incoming" ||die "could not open\n"; my $email=$parser->read(\*FILE)||die "could not parse\n"; close FILE; ## Now $email is a MIME::Entity. if (!$email->parts) { my $bodyh=$email->bodyhandle; my $IO = $body->open("r") || die "open body: $!"; open OUTFILE, ">body"; while(defined($_ = $IO->getline)) { print OUTFILE; } $IO->close; close OUTFILE; } else { print "This is a multipart MIME message, and I need to do more work +to be able to read it.\n"; } $email->purge;

Hopefully that gets you started... No guarantees against typos in the code...