PDA

View Full Version : E-mail form script


Milp
12-02-2002, 03:30 PM
I'm a newbie to CGI and Perl and have been trying to put together a scrpit (FormMail.cgi) to process my e-mail form submissions. So far, nothing has worked. Here's what I have at the moment:

#!/usr/bin/perl
$mailprog = '/usr/sbin/sendmail -i -t';
@referers = ('[my e-mail address');
@recipients = ('[my domain name]);
chmod 755 FormMail.cgi

print "Content-type: text/html\n\n";
# Get the form variables
&ReadParse();
$realname = $in{'realname'};
$email = $in{'email'};
$subject = $in{'subject'};
$comments = $in{'comments'};

I get an error page when I submit something with the form.

I'd be very grateful if someone could give me a basic script that will work, or point out what is wrong with the above. Please help!

Eamonn

pb&j
12-02-2002, 05:47 PM
Depending on your host server's setup, some of your coding may need adjusting.

I am no expert, but I do have a script you can use and pick apart. It's too long to post, so I will try it as an attachment on this.

If your host server does not have the CGI.PM module installed (most probably do), there is a different version I have too.

Milp
12-03-2002, 04:32 PM
Wow, thanks. I'll give this a try and get back to you!

Eamonn

Milp
12-04-2002, 01:34 PM
How do I chmod my cgi? I can't use Telnet, and I can't use IE (which I use for FTP) as right-clicking is disabled on the machines I use.

pb&j
12-05-2002, 03:39 AM
I use my FTP program (SmartFTP (http://www.smartftp.com/)) to change the CHMOD. Some hosts may have a "Control Panel" area which should give you the ability to CHMOD as well.

If it isn't possible to use an FTP program with this ability AND nothing from your host, I don't know what other options are available. You may want to start a new post in the forum asking others about this specific topic.
"How to CHMOD without telnet or FTP"