FormMail Tutorial

The cgi-bin

A form mail script is a programme that enables your website to communicate with the server and send an email. The script is often written in Perl hence the .pl suffix. The script processes the content of your form fields and sends the results to a specified "recipient". As most servers are protected from access by website users there needs to be somewhere that the script can operate without compromising the servers protection. That place is usually the cgi-bin, which is a directory (folder) in your web space. The Common Gateway Interface is what all servers use to process requests from applications like your browser. A gateway is a program, or script, that acts as mediator between servers and client.

There are four common situations -

1. Your ISP has a pre-configured script in place already for you.

2. Your ISP will allow you to put your own formmail script in your own cgi-bin.

3. Your ISP uses a different script

4. Your ISP does not allow such scripts

Assuming your ISP will let you put the script "formmail.pl" on your server there is a little information that you need to acquire from them:

1. Ask them where the cgi script should go (you will have to ftp it to the cgi-bin or cgi folder at the location they give you) or easier still, they may put it there for you.

2. Ask them for the location of the sendmail programme on their server. Typically this is something like '/usr/sbin/sendmail'

If your ISP says NO, then ask them what form script they will let you use and how to configure it. Depending on what script they use, this tutorial may or may not help you. In this instance, you may want to consider changing your ISP or upgrading to a more commercial service.

 

back    next