File: //ibin/emailtest
#!/usr/bin/perl
$to = 'test@posimp.com';
#$from = 'jack@web56.net';
$from = 'test@posimp.com';
$subject = 'Test Email';
$message = 'This is test email sent by Perl Script';
$mailprog = '/usr/lib/sendmail -f ';
#open(MAIL, "|/usr/sbin/sendmail -f");
open (MAIL,"|$mailprog $from $from, $bcc_email") || die "Can't open $mailprog!\n";
# Email Header
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n\n";
# Email Body
print MAIL $message;
close(MAIL);
print "Email Sent Successfully\n";