Gossamer Forum
Home : Gossamer Threads Inc. : Discussion :

Perl Problem...

Quote Reply
Perl Problem...
I am trying to create a feedback form for my visitors and have created the html page with the correct fields and field names and the form is posted to a file called form.pl

This is the code I have in form.pl...

#!/usr/bin/perl

use CGI;
$cgi = new CGI;

$admin = "paul\@audio-grabber.com";
$mailprog = "/usr/sbin/perl";

$name = $cgi->param("requiredName");
$age = $cgi->param("requiredAge");
$email = $cgi->param("requiredEmail");
$country = $cgi->param("requiredCountry");
$comments = $cgi->param("requiredComments");

print $cgi->header."

<b><i>Message Sent!</i></b><BR>
<BR><small>You supplied the following information:

<table><TR><TD><small>Name:</td> <TD><small>$name</td></tr>
<TR><TD><small>Age:</td> <TD><small>$age</td></tr>
<TR><TD><small>Email:</td> <TD><small>$email</td></tr>
<TR><TD><small>Country:</td> <TD><small>$country</td></tr>
<TR><TD><small>Comments:</td> <TD><small>$comments</td></tr></table>
<p>A reply will be given asap if necessary!</small>
";


sub send_mail {
open(MAIL,"|$mailprog -t");

print MAIL "To: $admin\n";
print MAIL "From: $email\n";
print MAIL "Subject: Audio-Grabber Feedback\n\n" }
print MAIL "Below is the result of your feedback form. It was submitted by $name\n";
print MAIL "Results are below:\n";
print MAIL "$name\n";
print MAIL "$age\n";
print MAIL "$email\n";
print MAIL "$country\n";
print MAIL "$comments\n";


Wherever I seem to call &send_email; I get an internal server error. How do I send the actual email?

What am I doing wrong?

Do I need the backslash here too?
$admin = "paul\@audio-grabber.com";

Thanks!

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Subject Author Views Date
Thread Perl Problem... Paul 6129 Dec 29, 2000, 10:32 AM
Thread Re: Perl Problem...
Bearwithme 5921 Dec 29, 2000, 10:41 AM
Post Re: Perl Problem...
Paul 5921 Dec 29, 2000, 10:42 AM
Post Re: Perl Problem...
Paul 5903 Dec 29, 2000, 10:45 AM
Thread Re: Perl Problem...
Andy 5875 Dec 31, 2000, 7:35 AM
Thread Re: Perl Problem...
Paul 5859 Dec 31, 2000, 7:39 AM
Thread Re: Perl Problem...
Andy 5858 Jan 2, 2001, 9:32 AM
Post Re: Perl Problem...
Paul 5814 Jan 2, 2001, 9:39 AM