How to Create a Contact Form using Formmail

Step 1: Download the newest copy of the Form Mail script from
Step 2: Unzip the archive and open the file using your preferred text editor (e.g. notepad).
Step 3: Edit the following settings located at the top of the file…

$mailprog = ‘/usr/lib/sendmail -i -t’;
… and replace with:
$mailprog = ‘/usr/sbin/sendmail -i -t’;
Now locate:
@referers = (‘’,’′);
… and replace with:
@referers = (‘’);
Note: Make sure that you replace with your actual domain name.

Step 4: Using FTP, upload the saved file from step 3 to the cgi-bin for your website (normally found at public_html/cgi-bin).
Step 5: Still using FTP, change the permissions of the file to allow it to be executable (e.g. 0755).
Step 6: Open the file you wish to place the contact form on and paste the following code.

<form id=”contact” name=”contact” method=”POST” action=”/cgi-bin/”>
<label>Your Email: </lable><input type=text name=”email” /><br />
<label>Subject: </lable><input type=text name=”subject”/><br />
<label>Message: </lable><textarea name=”body” id=”body” cols=”45″ rows=”5″></textarea><br />
<input type=hidden name=”recipient” value=”” />
<input type=hidden name=”redirect” value=”“/>
<input type=”submit” name=”button” id=”button” value=”Send” />

Step 7: Save the file and execute the link.

Related Articles