#!/usr/bin/perl
# Copyright by Wendy Willard. All right reserved.
# email.cgi  Chop Point Email Page
#
#   ##############################################################
# include the standard cgi library
require 'cgi/lib.pl';
##### get input from form 
&ReadParse
print
&PrintHeader
unless ($in{'name'}) {$in{'name'}='name not entered'};
unless ($in{'email'}) {$in{'email'}='not entered'};
open(MAIL, "|/usr/sbin/sendmail -oi -t") ||&MailError;
print MAIL "To: email\@choppoint.org\n";
print MAIL "Reply-to:$in{'email'} ($in{'name'})\n";
print MAIL "From: $in{'email'}\n";
print MAIL "Subject: $in{'recipient type'} $in{'recipient name'}\n\n";
print MAIL "---------------------------------------------------------\n"
print MAIL "$in{'name'} (mailto:$in{'email'}) send the following\n";
print MAIL "from the Chop Point Web Page:\n\n";
print MAIL "---------------------------------------------------------\n"
if ($in{'message'}){
     print MAIL "$in{'message'}";
}
print MAIL "\n---------------------------------------------------------\n"
print MAIL "Campers: please see a staff member to reply this email.\n";
close (MAIL);

# send the response for submitting this form

open IN, "good.html";
print while <IN>;
close (IN);

# Error opening data file

sub DataError {
    open IN, "bad.html";
    print while <IN>;
    close (IN);
    exit;
}