If you want to create a form that allows people to enter information on your web site and have that information sent to you via email, one option is to use a standard HTML form that uses a CGI script on the www.sfu.ca server called mailto.pl.
Below is a sample of a simple form. This is just the segment of the web page that contains the form element, so the usual HTML headers, etc. are not shown here.
<!-- set the 'action' attribute of your FORM element to be "http://www.sfu.ca/cgi-bin/mailto.pl" -->
<FORM method="POST" action="http://www.sfu.ca/cgi-bin/mailto.pl">
<!-- the rest of your form follows the standard HTML format for creating forms, as in these next few lines -->
<P>E-Mail address: <INPUT NAME="email" SIZE=36></P>
<P>Name: <INPUT NAME="name" SIZE=40><P>
<P>Send a greeting: </P>
<TEXTAREA name="body" rows=10 cols=60>Send a greeting here</TEXTAREA>
<!-- within your form you need to set a small number of special values as "hidden" so the people using your form don't think they have to set these values. These items determine who should receive the form, what the subject of the email will be, etc. -->
<!-- On the next line, substitute the e-mail address of the person who is to receive the form. This address should be an email address at SFU: eg. "firstname.lastname@example.org"-->
<input type="hidden" name="recipient" value="email@example.com">
<!-- On the next line, substitute an appropriate subject that is descriptive of the form-->
<input type="hidden" name="subject" value="Sample web form">
<!-- When your form is submitted, you can have the browser sent to another page (eg. a "thank you for your submission" page). The field name "redirect_url" is used for this. Note that in the value= line below, the greater-than symbols must be coded as ">" to prevent a greater-than sign from terminating your value statement prematurely.-->
<input type="hidden" name="redirect_url" value="<a href=http://www.sfu.ca/acs> the IT Services Home Page</a>">
<input type="reset" value="Clear Form">
<input type="submit" value="Send Form">
The following are additional options, not shown in the example, that you can use with the mailto.pl CGI:
- You can specify that all fields on the form must be filled in. Add a field called "nonempty" and set it to "yes" between the <form...> and </form> lines:
<input type="hidden" name="nonempty" value="yes">
- To specify that specific fields must be filled in, add as many fields named "required" as you need, and set each field to the value of the name of a required field on your form.
<input type="hidden" name="required" value="field1">
<input type="hidden" name="required" value="otherfieldname">
- You can also create an email template that formats the information in your form in a specific way when it is sent to you in email.