#!/usr/bin/perl #use diagnostics; use warnings; use strict; use feature ":5.10"; use Mail::Sendmail; my $mailTo = $ARGV[0]; my $mailFrom = $ARGV[1]; my $subjectLine = "Test Message"; my $message = "
This message is a test, and should not be considered a real message
"; my %mail = ( To => $mailTo, From => $mailFrom, Subject => $subjectLine, Message => $message, 'Content-Type' => 'text/html; charset="utf-8"' ); if (sendmail %mail) { print "Successfully sent mail to $mailTo!\n\n"; } else { print "Error sending mail: $Mail::Sendmail::error \n"; }