Just a simple subroutine that I have been using as a novice perl programmer. I know that it is not fully optioned and that many other libraries offer better email functionality but I think that it works great for me and I have reused it over and over, so for other novices like me out there here you go.
To use it just cut and paste it into your script, call it by using
&email(mail_prog,to,from,subject,body);
the fields I guess explain themselves
PS. you dont have to worry about assigning different variable names because it uses local varible names that are contained in the subroutine.
sub email {
local($mail_prog, $to, $from, $subject, $body) = @_;
open(MAIL, "|$mail_prog -t");
print MAIL "To: $to \n";
print MAIL "From: $from \n";
print MAIL "Subject: $subject \n\n";
print MAIL "$body";
print MAIL "\n\n";
close (MAIL);
}