#!/usr/bin/perl

use CGI::Carp qw(fatalsToBrowser);
use CGI;
use CGI qw(:standard);

$mailprog = '/usr/sbin/sendmail';

$query = new CGI;

$from=$query->param('from');
$to=$query->param('to');
$subj=$query->param('subj');
$message=$query->param('message');


open(MAIL, "| $mailprog -t");

print MAIL qq~Bcc: $to\n~;
print MAIL qq~From: $from\n~;
print MAIL qq~Subject: $subj\n~;
print MAIL "MIME-Version: 1.0\n";
print MAIL "Content-Type: text/html\r\n\r\n";

print MAIL qq~$message~;

close MAIL;

print "Content-type: application/x-www-urlformencoded\n\n";
print qq~loadkey=1&endsession~;

exit;

