#! /usr/bin/perl
use CGI;
use DB_File;
use strict;
my $request = new CGI;
my $root_dir = '/home/sites/www.decosta.com/';
my $db_file = $root_dir . 'users/donald/ahs81/ahs81.db';
my $http_method = $ENV{"REQUEST_METHOD"};
my $referer = $ENV{"HTTP_REFERER"};
my $to_index = $request->param("to_index");
my $to_name = $request->param("to_name");
my $from = $request->param("from");
my $subject = $request->param("subject");
my $message = $request->param("message");
my %classmates;
my @fields;
my $from_error;
# If we didn't come from the right place, abort
#if (!($referer =~ /^http:\/\/www.decosta.com/) || (!($to_index =~ /\d\d\d/))) {
# exit(1);
# }
print $request->header;
# If no $from or we're doing a GET toss up the e-mail form
if ((!($from =~ /.*\@.*\..*/)) || ($http_method eq "GET")) {
if ($http_method ne "GET") {
$from_error = '
A valid FROM e-mail address is required';
}
print <AHS '81 Mailer
AHS '81 Classmate E-mailer