my %input=%{getforminput()};
my $validto = "jonadab\@bright.net,jonadab_homeip_net\@yahoo.co.uk";
if ($validto !~ $input{myEmail}) {
$errors .= "
The To: address you selected was not one of the available choices. Please pick an option from the dropdown list.\n"; }
if ($input{Email} !~ /^[^@]+[@][^@]+$/) {
$errors .= "The From: address you entered does not appear to be valid. Please enter a real email address.\n"; }
if (not $input{Subject}) {
$errors .= "You left the subject blank. Please fill in a short description of what your message is about.\n"; }
if (not $input{Message}) {
$errors .= "You left the message itself blank. Surely you had something to say?\n"; }
if ($errors) {
print "Content-type: text/html
\n\nError(s) encountered\n
\nOne or more errors were encountered when trying to send your message.
Please hit your browser's back button and correct the following issues:\n
\n\n\n";
exit 0; # Update: If there were errors, we don't want to send the message.
}