Form Mailer Example
Forms without coding
Our new forms capability doesn't require coding and saves all submissions in a database for easier processing. See Forms and Surveys for more information.
You may incorporate a simple form such as this on your web page that will send email to you with the information submitted. In order to produce this form mailer on your web page, you may duplicate the form mailer code below. Be sure to review the name/value pairs. If your web page is not on CampusWeb with an address like http://www.wwu.edu/xxxx then contact firstname.lastname@example.org for more information.
The template comes pre-built with "contact.shtml," an HTML5-based outline of a form that is ready to be customized with the advanced options below. Please copy contact.shtml and use it as a base for the generation of additional forms.
Specifying a Recipient
To prevent misuse of the form, the recipient address for the form is not contained in the form or on the page on which the form exists. Rather than supplying the email address directly, the 'recipient' field should specify a site-relative path to a file that contains nothing but a single line: the recipient's email address. See the example in the form below:
Customizing the look and feel of the form:
The template includes several classes intended to assist with customizing the look and feel of your form.
To change the color of the submit button, please use the "submitBlue", "submitGreen" or "submitRed" classes to alter it's color.
This is an example of the code required to use the options of this script.
<form action="http://www.wwu.edu/cgi-bin/mailer2.cgi" method="post"> <input type="hidden" name="recipient" value="/sharename/recipient.txt"> <input type="hidden" name="subject" value="Feedback form!"> <input type="hidden" name="required" value="email,name,comments"> <input type="hidden" name="bgcolor" value="#FFFFFF"> <input type="hidden" name="text_color" value="#000000"> <input type="hidden" name="background" value="http://www.wwu.edu/path/filename.jpg"> <input type="hidden" name="title" value="Thank you for your feedback!"> <input type="hidden" name="return_link_url" value="http://www.wwu.edu/sharename/gotourl.html"> <input type="hidden" name="return_link_title" value="Back to feedback form!"> Name: <input type="text" name="name"><br /> E-Mail: <input type="text" name="email"><br /> <br /> Comments: <br /> <textarea name="comments" rows="5" cols="30" wrap="virtual"> </textarea> <br /> <input type="submit" value="Submit"> <input type="reset" value="Reset"> </form>
The following name / value pairs are for configuration use only (used in hidden form input fields):
|recipient||path||Site-relative path to a file that contains nothing but a single line: the recipient's email address. "/depts/provost/recipient.txt"|
|email address||This can be a textbox or hidden input
that specifies the email address where
the form data is sent from.
|subject||text||This is the subject of the email.
(i.e., form submission)
|This is a comma seperated list of required
fields. (i.e., name,email,comments) Note
no spaces between the names.
|redirect||URL||This is the URL to a user specified response generated on
successful form submission.
|bgcolor||color name/code||Background color of the response pages|
|background||URL||URL to backround image|
|text_color||color name/code||Text color of the response pages|
|link_color||color name/code||Link color of the response pages|
|alink_color||color name/code||Active link color of the response pages|
|vlink_color||color name/code||Visited link color of the respnse pages|
|Title of the successful submission response page|
|return_link_url||URL||The URL to page where the successful response page links|
|return_link_title||link text||Text to above link|
|missing_fields_redirect||URL||This is a URL to a user specified response to missing fields.|
For an improvement to the form to prevent automated (spam) responses to this form, please see our how-to on adding an Anti-Spam Check for your web page.