#!/usr/pkg/bin/perl -w

use CGI;
CGI::ReadParse(*vars);

# Send the email

my $sendmail = "/usr/sbin/sendmail -t";
my $to       = "To: Changing Perspectives Exhibition Committee President <shimaneart@hotmail.com>\n";
my $subject  = "Subject: JAGS Application for $vars{'name'}\n";
my $content=<<"TheEnd";
Full Name: $vars{'name'}
Full Name (Katakana): $vars{'katakana'}

Email: $vars{'email'}
Phone: $vars{'phone'}

Home Country: $vars{'country'}
Gender: $vars{'sex'}

Where do you live in Shimane: $vars{'live'}
What do you do in Shimane: $vars{'do'}

Sum up your perspective of Shimane in ONE WORD: $vars{'word'}

Media (photography, painting, ceramics, digital art etc.): $vars{'media'}

If possible, please provide us with further details below: 
$vars{'details'}
TheEnd
;

open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $to;
print SENDMAIL $subject;
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $content;
print SENDMAIL "\n.\n";
close(SENDMAIL);

print "Location: ../thanks.shtml\n\n";
