E-Mail CGI

The instruction contained herein can be used to create a new or modify an existing HTML form to work with a preinstalled script located on the Univox servers. The e-mail script resides in the server's cgi-bin directory and does NOT have to be installed within your own account. Merely reference this script as illustrated in the following HTML form action:

<form method="post" action="/cgi-bin/mail/Mail.cgi">

This code calls the preinstalled script which is in the server's cgi-bin directory once the web page visitor clicks the "Submit" button. The script parses the contents of the form and compiles it into an e-mail which is sent out through the SMTP server to the recipient.

To set the recipient address add the following code to your HTML form:

<input type="hidden" name="recipient" value="yourname@yourname.com">

To set the subject of the form submission add this code:

<input type="hidden" name="subject" value="Information Request">

There are certain bits of information that you may want from the visitor such as their name and e-mail address. You can set up "required" items by adding this code:

<input type="hidden" name="required" value="Name,Email">

It is necessary to tell the script in what order to sort the items. The code may look like this:

<input type="hidden" name="sort" value="order:Name,Address,Address2,City,State,Zip,phone,Fax,Email,Message">

Upon submitting the form the visitor will have his information echoed back to him via an HTML page that is generated by the script. The title of this page can be specified with this code:

<input type="hidden" name="title" value="Your Inquiry">

You may want to route the visitor to a "thank you page" which you can create. You can specify a page to be called with this code:

<input type="hidden" name="return_link_url" value="http://www.yourdomain.com/thanks.html">

In order to get to the "Thank You Page" from the page with the echoed form response a link will be placed on the page when it is generated. You can set the text for the page with this code:

<input type="hidden" name="return_link_title" value="Continue">

The background color of the echo page can be set using an HTML color by adding the following code:

<input type="hidden" name="bgcolor" value="#FFFFFF">

There are two more lines of code that need to be added in order for the form to work properly. They are:

<input type="hidden" name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT">
<input type="hidden" name="print_config" value="email">

It is important to note the text that is used for this script is case sensitive. For example if you specify a required field called "Email" and on the form you call it "email" it will not work. Also when you set a return link URL you must specify the entire path as in "http://www.yourdomain.com/thanks.html"

Now that this portion of your code has been configured it will be necessary to build your form in HTML code. Please refer to the Univox FAQ "Forms" for information on this. If you would like to see an example of a working e-mail form you can click here.

Return to table of contents

© 2007 Univox Internet, Inc.