#!/bin/perl -- -*-perl-*- -w #----------------------------------------------------- # Ross's CGI Form Mailer -copyright 2001- # Last Modified 08/11/2001 #----------------------------------------------------- $mailprog = '/usr/lib/sendmail'; $recipient = 'ross@timeplan.ltd.uk'; #$data = $ENV{'QUERY_STRING'}; #$data = getenv("QUERY_STRING"); #print "Content-type: text/html\n\n"; #print "Demo request sent"; #print " #

Demo Request Sent Sucessfully

"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); #print "Name = $name , Value = $value
"; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # $value =~ s/~!/ ~!/g; # print "Setting $name to $value

"; $FORM{$name} = $value; } #print "email = $FORM{'email'}
"; open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n"; print MAIL "Reply-to: $FORM{'email'}\n"; print MAIL "Subject: $FORM{'subject'}\n\n"; print MAIL "$FORM{'name'}\n"; print MAIL "wanted to contact $FORM{'contactPerson'}\n\n"; print MAIL "With the comments: \n"; print MAIL "$FORM{'message'}"; print MAIL "\n\n"; print MAIL "Server information:\n"; print MAIL "Server protocol: $ENV{'SERVER_PROTOCOL'}\n"; print MAIL "Remote host: $ENV{'REMOTE_HOST'}\n"; print MAIL "Remote IP address: $ENV{'REMOTE_ADDR'}\n"; close (MAIL); print "mailSent=true"; #print "Thank you for your request for our Fuel Wizard demo.\n"; #print "You will be contacted within the next few working days.\n"; #print "Please close this window to continue browsing our site\n"; # sub blank_response # { # print "Your entries appear to be blank, and thus were not sent "; # print "Please re-enter your comments, or close this"; # print "window to continue browsing our site"; # exit; # }