#!/usr/bin/perl -w
use strict;
my $email = 'recipient@chosenreceipient';
my $sender = 'sender@sender';
my $subject = 'Email Test';
my $time_stamp = localtime;
my $contents = "\nThis is a test email sent by:\n\n$sender\n\nto\n\n$email\n\nregarding $subject.\n\n$time_stamp\n\n";
open (MAIL, "|/usr/lib/sendmail -t") || die "Cant' open mailprog\n";
print MAIL "To: $email\n";
print MAIL "From : $sender\n";
print ("Mailing: $email from $sender\n");
print MAIL "Subject: $subject\n\n";
print (MAIL "$contents");
close(MAIL);
exit;