LexiConn Knowledgebase

Knowledgebase Home | Favorites Knowledgebase Home | Favorites
Search the Knowledgebase Browse by Category
Article Details

Last Updated
29th of March, 2011

User Opinions (435 votes)
88% thumbs up 11% thumbs down

How would you rate this answer?
Not helpful

formmail.cgi should already be in your cgi-bin directory. Formmail is a simple-to-use cgi script that will email to you the contents of a web based form. To use it, simply reference it in your html page like:

<form action="http://www.your_domain.com/cgi-first_part_of_domain/formmail.cgi" method="POST">
(where your_domain.com is replaced with your actual domain name, and first_part_of_domain is replaced with your domain name, minus the extension/suffix.)

You will need to at least include the following line containing the email address of where you want the form information to be emailed to:

<input type="hidden" name="recipient" value="you@your_domain.com">
The recipient email address should be an alias at your domain, and not sent directly to a foreign address such as your Internet Provider's mailbox or hotmail account.

That's it! Of course, there are lots of other configuration options you can set to customize how the email will look, require certain fields, and redirect the user to a URL after submitting the form.

Here is example HTML code showing the parameters recipient, subject and redirect, as well as a simple form asking for name, email address, and a comments box:

<form action="http://www.your_domain.com/cgi-first_part_of_domain/formmail.cgi" method="post">
<input type="hidden" name="recipient" value="you@your_domain.com">
<input type="hidden" name="subject" value="Form Submission to your_domain.com">
<input type="hidden" name="redirect" value="http://www.your_domain.com/thankyoupage.html">
<p><b>Name:</b><br />
<input name="name" type="text" size ="40"><br />
<b>Email Address:</b><br />
<input name="email" type="text" size="40"><br />
<b>Comments:</b><br />
   <textarea name="Comments" cols="40" rows="10"></textarea>
   <input name="submit" type="submit" value="Submit">

The link below contains full documentaion on the various options for customizing formmail.cgi:

Related Articles
No related articles were found.
No attachments were found.

Powered by Interspire Knowledge Manager Knowledgebase Software