#! /usr/local/bin/perl -w use strict; use CGI (); use Mail::Internet (); # avoid mailx etc. $ENV{'PERL_MAILERS'} = "mail:/donotuse:sendmail:/usr/sbin/sendmail"; $ENV{'MAILADDRESS'} = 'webmaster@mail.lns.cornell.edu'; my $to = "chris237\@gmail.com"; my $query = new CGI; my @fields = ( 'Name', 'Email', 'Phone', 'InstName', 'InstStreet', 'InstCity', 'InstState', 'InstZip', 'Lodging', 'ContactName', 'ContactPhone' ); print $query->header(); print <<"header"; LEPP - Resources
Documents Computing CESR Scoreboard Design & Publication Services


Outside Links

header if (!$query->param('Name')) { print "

Missing a name.

\nPress the back button and please provide your name.\n"; } else { my @body; for my $field (@fields) { push @body, sprintf("%-15s %s\n", $field.":", $query->param($field)) if $query->param($field); } push @body, sprintf("\nsubmitted from: %s (%s)\n", $ENV{'REMOTE_ADDR'}, $ENV{'REMOTE_HOST'} || "no reverse DNS" ); my $msg = Mail::Internet->new(Body => \@body); my $head = $msg->head; $head->replace('Subject', $query->param('Subject')); $head->replace('From', $query->param('Email')); $head->replace('To', $to); if ($msg->smtpsend(To => $to)) { # remove the remote host info pop @body; print qq(

Please review the following information and press the back button if changes are needed.

);
	print @body;
	print "

Your registration will be promptly reviewed. Thank you.

\n"; } else { print qq(

Script Error

Please send mail to service\@mail.lns.cornell.edu

); } } print <<"trailer";
trailer