Jump to: navigation, search

This information only pertains to Hurricane Electric's Shared Web Hosting package. There may be different information in our other categories.

This document demonstrates the use of the CGI script. Please note that while we're unable to provide detailed support for this script (for reasons such as bugs, compatibility issues, potential vulnerabilities, etc), we are able to provide this basic tutorial on setup for HTML forms on your Hurricane Electric hosted site. If you have any questions regarding the script itself, please see the NMS Support Page.


  • The script.

You can download the NMS FormMail script from the NMS download page. Be sure to grab the 'compat' version.

Prior to putting the script on your site, you'll need to configure it. Configuration is fairly simple, as it takes place entirely in the second 'page' of the script.

Once you've downloaded the .zip file from the above link, open it up, then open inside of your favorite text editor (we recommend 'notepad.exe' in Windows). Scroll down until you see the following:

   $DEBUGGING         = 1;

This is the beginning of the section you'll be editing. Here, you will edit the following lines:

$max_recipients    = 1;
$mailprog          = '/usr/sbin/sendmail -oi -t';
$postmaster        = '';
@referers          = qw(;
@allow_mail_to     = qw(; 

$style             = '';

You'll need to replace '' with your email address, and '' with your Hurricane Electric hosted website. The small change in '$mailprog' is important, so make sure you don't skip over it.

  • The form.

This is your standard HTML form with an ACTION which invokes the CGI script.

 Email Address: <input name="email"><p>
    Real Name: <input name="realname"><p>
    Shoe Size: <input name="shoe-size"><p>
 <li> <input type="checkbox" name="merchandise" value="2101">2101 - Blue Shoes
 <li> <input type="checkbox" name="merchandise" value="2102">2102 - Red Shoes
 <li> <input type="checkbox" name="merchandise" value="2103">2103 - Yellow Shoes
 <li> <input type="checkbox" name="merchandise" value="2104">2104 - Green Shoes
 <li> <input type="checkbox" name="merchandise" value="2105">2105 - Black Shoes
 <input type="submit" value="Order Now"> (Don't worry, this will only show you what an email message would look like.)
 <input type="hidden" name="addendum" value="This is the default success message.  You may also specify a URL as the 'value' of a 'hidden' input named 'redirect' to cause to jump to that URL if email is successfully sent.">
 <input type="hidden" name="required" value="email,realname,shoe-size">

Differences from cgiemail

Many of our long time customers will remember cgiemail, and wonder where it has gone. It's still exists for our legacy users, but we're recommending away from cgiemail, as it hasn't been supported for a very long time, and vulnerabilities do exist.

Required form entries are now designated inside a small array, as listed in the form above.

'From' addresses no long require lengthy procmail recipes! You can now simply use 'email' and 'realname' in the form, and the script will take care of the rest.

For information on what all the names and fields do, please see the README file inside the FormMail .zip file.