Here is a very simple cgi script to send the form

output to the target mail boxes:

One - cut and paste the code below into "notepad"

Two - edit the following lines:


Change to the "full path" to your cgi dir.

  $varSendFormDataTo = "user1\";

Change to your domain and user1 to the target user.

Make sure you have \@ and not a 'bare' @.

  $varSentFrom = "WebServer\";

If you want to send to more than one user, add a comma and

the new

  $varSubject = "Web Form Comments";

Change the Subject variable to what you want displayed on the email.

  $varJumpToWebPage = "";

This is the page you are redirected to - can be

any valid page anywhere on the internet.

Verify that sendmail is in your


directory. The quickest way is to type

'whereis sendmail'

Three - Save your file in your cgi directory.

  chmod 755 <file name>.

Four - Get from

Save in your cgi-bin directory.

Five - Number your form elements. e.g. add

a #- to the front of each name (FullName

becomes 1-FullName, Email become 2-Email).

The program expect numbers and splits on

the first '-'. This allows you to number

the form elements in the order you want them

to appear in the email.

Six - Don't forget to set your action

to "/cgi-bin/qd-form.cgi" and remove any

form encoding types you have set.

Good Luck.



# Quick & Dirty Form Processing....

BEGIN {unshift @INC, '/full/path/to/cgi-bin/' };

require "";


## User Set Variables

$varSendFormDataTo = "user1\";

$varSentFrom = "WebServer\";

$varSubject = "Web Form Comments";

$varJumpToWebPage = "";


## System Set Variables

$varSendMail = "/usr/sbin/sendmail -t -n";

$today = `date`;


open (MAIL, "| $varSendMail") || die "cannot open mail program";

print MAIL "To: $varSendFormDataTo


print MAIL "From: $varSentFrom


print MAIL "Subject: $varSubject


print MAIL "$today


foreach $var(sort keys %input) {

if (lc($var) eq "submit") {next;}

$varTrimmed = splut(/-/,$var,2);

print MAIL "$varTrimmed -- $input{$var}



print MAIL "


close(MAIL) || die "mail pipe exited $?";

print "Location: $varJumpToWebPage