GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

VPS v2: FormMail CGI: Generate E-Mail from an HTML Form

bullet Introduction

FormMail is a CGI program designed to generate e-mail based on the input from an HTML form.

 

bullet Installation

To install the FormMail CGI on your Virtual Private Server, connect to your server via SSH, su to root, and do the following:

# vinstall formmail

This command installs three files, FormMail.pl, FormMail.examples and FormMail.readme, into your /www/cgi-bin directory. The examples and readme files contain various information and examples on using FormMail.

You will need to set up the script to use your account information. Open the file FormMail.pl and modify the following lines in the USER CONFIGURATION SECTION.

  • Find the line and replace the information inside the parentheses with your own server's domain name(s) and IP address. You can leave the localhost value.

  • In the line, remove the original E-mail addresses and put either the domain, or a full E-mail address for every account that should be allowed to receive Email messages from this form. For security reasons, unless you have a large number of Email accounts at a single domain, it is better to list the full address for each recipient.

Once you have modified these two fields, save the file.

 

bullet Usage

Create a form that you would like the contents mailed to some address. The form should include the following field (at the very least):

  • recipient = specifies who mail is sent to

Other optional fields can also be used to enhance the operation of FormMail for you site, for example:

  • subject = specify the subject included in e-mail sent back to you

  • email = allow the user to specify a return e-mail address

  • realname = allow the user to input their real name

  • redirect = URL of page to redirect to instead of echoing form input

  • required = list of field names that are required input (comma delimited)

Several other fields are supported. See the FormMail.readme file for a complete presentation of the supported fields.

For example, the HTML source for your form may look like this:

<form method="POST" action="/cgi-bin/formmail.pl">
<input type="hidden" name="recipient" 
       value="order.com">
<input type="hidden" name="subject" 
       value="Order Request">
<input type="hidden" name="required" 
       value="realname,email,phone">
Please Enter Your Name:<br>
<input name="realname" size="40">
<p>
Please Enter Your Email Address:<br>
<input name="email" size="40">
<p>
Please Enter Your Phone Number:<br>
<input name="phone" size="40">
<p>
.
.
.
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>

Once your form is complete, you should be able to send E-mail messages using it.


Toll Free 1-866-GSP-4400 • 1-301-464-9363 • service@gsp.com
Copyright © 1994-2016 GSP Services, Inc.