I might also suggest Mail::Mailer. Here is a proof-of-concept program for you to look at that acts as a Perl-based email transmission client:
#!/usr/bin/perl -w
use Mail::Mailer;
$smtp = Mail::Mailer->new("smtp","Server","smtp.server");
print "To: ";
$to = <STDIN>;
chomp($to);
print "Subject: ";
$subject = <STDIN>;
chomp($subject);
print "Body:\n";
while ($line = <STDIN>) {
last if $line eq ".\n";
$body .= $line;
}
chomp($body);
print "Opening SMTP connection...\n";
$smtp->open({
"From" => "email\@example.com",
"To" => $to,
"Subject" => $subject
});
print $smtp $body;
print "Sending email...\n";
$smtp->close() or die "Can't close mailer: $!";
print "Mail sent.\n";
Obviously, using strict is recommended.