here goes...
here is the form page:
index.html
**
<body>
<form action='sendmail.cgi'>
<br><br>
enter your email address
<br>
<input type=text name=eml>
<br><br>
what is the subject?
<br>
<input type=text name=sbj>
<br><br>
what would you like to say?
<br>
<textarea name=msg rows=3 cols=30></textarea>
<br><br>
<input type=submit value='send mail'>
</form>
</body>
**
here is the cgi:
sendmail.cgi:
**
#!/usr/local/bin/perl
%postInputs = readPostInput();
$dateCommand = "date";
$time = `$dateCommand`;
open (MAIL, "|/var/qmail/bin/qmail-inject"

|| return 0;
select (MAIL);
print << "EOF";
To: test\@one-degree.com
From: $postInputs{'eml'}
Subject: $postInputs{'sbj'}
$time
Comments: $postInputs{'msg'}
<b>test</b>
EOF
close(MAIL);
select (STDOUT);
printThankYou();
sub readPostInput(){
my (%searchField, $buffer, $pair, @pairs);
if ($ENV{'REQUEST_METHOD'} eq 'POST'){
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'} );
@pairs = split(/&/, $buffer);
foreach $pair (@pairs){
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$searchField{ $name} = $value;
}
}
return (%searchField);
}
sub printThankYou(){
print << "EOF";
Location:
EOF
}
**
and finally here is the thank you page:
thankyou.html
**
<body>
<br><br>
thank you. you message has be sent.
</body>
**
to check it out in action, go here...
hope that helps...
my suggestion is if you have questions from this point, try the cgi forum...very helpful...
- spewn