17 Years Successfully Designing, Hosting and Promoting Websites
Websites Online is honored to be a
And winner of the
The instruction contained herein can be used to modify an existing HTML form to work with a preinstalled script called cgiemail. The cgiemail script resides in the server's cgi-bin directory and does NOT have to be installed within your own account. Merely reference cgiemail as illustrated as illustrated in the following HTML form action:
This code calls the preinstalled script cgiemail which is in the server's cgi-bin directory once the web page visitor clicks the "submit" button. The script cgiemail in turn calls a text file (or template) called mailtemp.txt. The template defines the format by which the submitted form content is to be sent via email.
You can create the template in a basic text editor beginning with the following two lines:
To: email@example.com Subject: Information Request
Substitute the desired recipient email address and subject above. Next, you will need to add ALL field names within the HTML form to the template in a form similar to the following:
To: firstname.lastname@example.org Subject: Information Request Name [name] Address [address] Phone [telno]
As long as each form field name is contained within brackets ("[ ]") within the template, the email should be sent successfully and contain all submitted data. We suggest you use all lowercase field names within your HTML form and template. Be sure to upload the template in ASCII transfer mode.
If you want a specific web page to load when the email is successfully sent, such as a thank you note, add the follow code to your HTML form:
Substitute the URL of the file you wish to load after form data is submitted. The field name in this case MUST be "success", but does not need to be added to the template.
*** Important ***
*** Helpful Tip ***
First, add a field to the HTML form (e.g. "email" to prompt the visitor for his/her complete email address. Next, add the field name to the corresponding template in the following manner:
To: email@example.com From: [email] Subject: Information Request
The cgiemail script will insert the address entered in the field named email. When the emailed form is received it will be tagged with this return address.
Search this site by typing in your search term then click the search button.
Please contact the
Webmaster with comments about this site.