This information explains how you can have the results of HTML forms sent to an e-mail address. This is available in both departmental and individual webpages on campus.
There are two ways to use this program. The first is by having mail go to an e-mail address that ends "@usask.ca." The second is to have us define a nickname that points to any e-mail address.
This program works for any e-mail address that ends with "@usask.ca" without the need for pre-registration of a nickname. You implement this using the following steps.
In either case, the mail will be sent to firstname.lastname@usask.ca.
If you need to send mail to an address that does not end "@usask.ca" then you need to set up a nickname using the following procedure
Where "nickname" is the nickname for the e-mail address registered with the webmaster.
You can optionally add the following lines to your form to turn on advanced features.
This specifies a subject for the e-mail message that is sent. In this case it is "message subject", but you can have anything you want in there. If you want clients to be able to enter their own subjects, then remove the type="hidden" option.
Use this to give a custom confirmation message when the form is completed. Create a webpage containing the confirmation then give its complete URL with the "value=" option (in the example it is called "done.html"). Note that this must be an absolute URL. When the user submits the form, the page pointed at by the "value=" option is displayed.
This sets the return address on the e-mail to whatever the person enters in this field. The "Your E-mail" can be any text you want, and the "size=" can be any size you want. However, the name="from-email" must appear as shown.
This sets the sender's personal name on the e-mail. The "Your Name:" can be any text you want, and the "size=" can be any size you want, but the name="from-name" must appear as indicated.
The "requirefields" option specifies items on the form which must be completed before the form results are mailed. The "Fieldname_1", etc. are the names of the fields that must be completed. For example, if people must enter a return e-mail address the "Fieldname_1" would be "from-email".
The "ignorefields" option specifies a list of form fields that will not be included in the resulting email message.
The following is an example form. We create an e-mail address called "web.master@usask.ca" to send mail to the campus web coordinators. We also created a "next-url" page called "webmaster_mail_done.html" to be displayed after the form is completed. The form requires that the "from-email" and "comment" fields be entered.
Here is a simple form to send a short message to the webmaster:
Your Name Is: <br />
Your Message:<br /> <textarea name="comment" rows="3" cols="60"></textarea>
Please visit the w3schools.com web site for more information on how to develop and use forms in your webpages.
Information and Communications Technology
Saskatoon, Saskatchewan
Canada
ICT Help Desk: 306-966-4817 or 1-800-966-4817
ICT Finance and Administration Office: 306-966-4866
Contact Us | Site Index | Provide Website Feedback
© U of S 1994 –
Disclaimer
Policies