Form Mailer Example

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 webhelp@wwu.edu for more information.

Specifying a Recipient

To prevent misuse of the form, the recipient address for the form is cannot be 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.

Name:   
E-Mail:   

Comments
 
 

 Form Code 

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/generic_mailer_example.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):

name value DESCRIPTION
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 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)
required comma seperated 
list
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 Response document 
title
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.

Page Updated 03.24.2014