| FormMail
Basic instructions for using the form handling cgi script.
- For Advanced Configuration options, please click
here
For our clients who need a form handler to take data from online forms and then email that data to their email address we provide a cgi script called FormMail.
This is a highly configurable script which takes all of its configuration information from the form fields in the forms that you create on your web pages.
An equivalent for PGP mail (dual-key encrypted mail) is available, but requires some setup on our server
as well as your e-mail client. Please email support@wedohosting.com for further instructions.
Here is an example of the code used in a simple form:
<form
action="http://scripts.wedohosting.com/common-cgi/formmail.cgi"
method="POST">
<input type=hidden name="recipient" value="webmaster@yourdomain.com">
<input type=hidden name="redirect" value="http://www.yourdomain.com/thanks.htm">
Subject:
<input type=text name="subject" size="30"><br><br>
Name:
<input type=text name="name" size="40"><br><br>
Comment: <br><textarea name="comments" rows="4"
cols="20"></textarea><br><br>
<input type=submit value="submit"> </form>
In the above example every time the form is filled out and submitted,
the results will be sent to webmaster@yourdomain.com.
Once the form is submitted the person's browser
will be redirected to our home page at "http://www.wedohosting.com/".
In almost all cases you will want to make the "recipient"
input type as hidden and set to your email address. The recipient
MUST be an e-mail address at your domain name (ie, someone@yourdomain.com)
to prevent this form from being used for e-mail spamming.
The
"redirect" options is useful if you want to redirect
a person who submitted a web form to a thank you page. If
you do not use the redirect option the results of the form
submission will be displayed to the browser with a thank you
message.
The
example form lets the user fill in three areas: a subject
(which appears as the Subject line in the email), their name,
and a comment.
Here
is another example that will allow you to see the formating
of the resulting email to you. Be sure to fill in YOUR email address. This page doesn't have a redirect
set so the results of the form get displayed to the browser:
Here is the code for the form:
<form
action="http://scripts.wedohosting.com/common-cgi/formmail.cgi"
method="POST">
<input type=hidden name="recipient" value="webmaster@wedohosting.com">
<input type=hidden name="realname" value="Email
Form">
Your
Email Address: <input type=text name="email"
size="30">
<br><br>
Subject:
<input type=text name="subject" size="30">
<br><br>
Your
Name: <input type=text name="name" size="40">
<br><br>
Comment:
<br>
<textarea name="comments" rows="4"
cols="20"></textarea>
<br><br>
<input type=submit value="submit">
</form>
In this example "recipient" is allowing you to input
your email address as the "To:" field. This is so
that you can recieve the emailed results and see how the "Your
Name" and "Comment" entries are presented.
There
are many more options you can use in the forms. Please see
the link below to see what they are. Please also remember
that these are "reserved" fields specific to the
form and shouldn't be used as input "name" designations.
Click here for Advanced FormMail Configuration
Files and Glossary of Possible Fields.
In
the two example forms above "name" and "comments"
are not reserved words in the formmail.cgi scripts and I was
able to use them as input field in the forms.
|