Online forms allow for a website user to send written information in a simple layout to a pre-defined email address, (e.g. firstname.lastname@example.org) that includes various contact details. FormMail.pl is a CGI script that can be used to send typed data on a web page to a recipient's email address. This script comes pre-configured on all Netregistry web hosting packages except Economy Hosting. Additionally, the CGI script is not supported on our Windows and Apache servers. If you have Economy hosting, you will need to upgrade to Business Hosting and request the Zeus server. FormMail is generally used for:
- Enquiry forms
- Feedback forms
- Order forms
Note: FormMail is dependant on correct @referrer scripting.
How do I add a form to my website?
FormMail.pl is one of the default scripts included in the cgi-bin directory of your hosted web space.
To set up a form mail form:
- Log into your Account
- Click to manage the domain you want to edit
- Click Cloud Hosting
- Click Applications
- Look for formmail and make sure the Install Location is blank
- Click Install formmail
- Add the following formmail script to your web page:
<html> <body> <form method="post" action="/cgi-bin/formmail/FormMail.pl"> <input type="hidden" name="recipient" value="email@example.com"/> <input type="hidden" name="subject" value="Form Submitted Email" /> <input type="hidden" name="required" value="email" /> <p>Please enter your Name:</p><input name="Realname" /> <p>Please enter your Email:</p><input name="email" /> <p>Enter your comments:</p> <textarea cols="19" rows="5" name="User_Comment"></textarea> <input type="submit" value="Send Comments" /> </form> </body> </html>
Note: The recipient is a required form field and must be included. in the above example, the subject, realname and user_comments fields are optional form fields. Optional form fields may be included as required or to personalise the form to meet the required needs of the web page. This information is sent to the recipient email address specified once a user clicks [Send Comments]:
Date: Fri, 3 Jul 2010 13:33:30 +1000 To: firstname.lastname@example.org Subject: Form Submitted EmailEmail: Below is the result of your feedback form. It was submitted by realname() on Friday, July 3, 2010 at 13:33:30 --------------------------------------------- user_comment: These are the comments typed into the comment field.---------------------------------------------
Note: The code in this article is for information only. We cannot provide support for website coding related issues. Please contact a website developer for issues related to programming with HTML.