Get familiar with the perldocs. On a *nix system, you can do "perldoc perl" to get started. "perldoc -h" also works.
perldoc -q mail
gives back a lot of info - here is some of it:
---------------------------------------
=head2 How do I send mail?
Use the C<sendmail> program directly:
open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq"

or die "Can't fork for sendmail: $!\n";
print SENDMAIL <<"EOF";
From: User Originating Mail <me\@host>
To: Final Destination <you\@otherhost>
Subject: A relevant subject line
Body of the message goes here after the blank line
in as many lines as you like.
EOF
close(SENDMAIL) or warn "sendmail didn't close nicely";
The B<-oi> option prevents sendmail from interpreting a line consisting
of a single dot as "end of message". The B<-t> option says to use the
headers to decide who to send the message to, and B<-odq> says to put
the message into the queue. This last option means your message won't
be immediately delivered, so leave it out if you want immediate
delivery.
Or use the CPAN module Mail::Mailer:
use Mail::Mailer;
$mailer = Mail::Mailer->new();
$mailer->open({ From => $from_address,
To => $to_address,
Subject => $subject,
})
or die "Can't open: $!\n";
print $mailer $body;
$mailer->close();
The Mail::Internet module uses Net::SMTP which is less Unix-centric than
Mail::Mailer, but less reliable. Avoid raw SMTP commands. There
are many reasons to use a mail transport agent like sendmail. These
include queueing, MX records, and security.
---------------------------------------
The perldocs is you online local(to your system) source of perl information for your installation - they come with the standard perl installation.
HTH.
Hardy Merrill
Mission Critical Linux, Inc.