
![[Back to RiceInfo]](http://www.rice.edu/images/navbar.gif)
Yamform, which stands for "Yet Another Mail Form", is a forms-handling program for use with World Wide Web forms. The difference between yamform and other common mail-based forms-handling programs is that yamform allows the designer of the form to control the format of the resulting e-mailed report -- not just the input format but the output format as well.
Sections of this page:
<form method=POST action="http://www.rice.edu/cgi-bin/yamform?cwis@rice.edu">Multiple e-mail addresses may be specified, separated by commas:
<form method=POST action="http://www.rice.edu/cgi-bin/yamform?cwis@rice.edu,riddle@rice.edu">
Enter your e-mail address: <input type=text name=from><br> <em>(Complete address, e.g. "jdoe@foo.edu"!)</em>
<input name=subject type=hidden value="Favorite color report from $from">
<input name=outform type=hidden value="
Favorite color report
Name: $name
E-mail address: $from
Favorite color: $color
">
Note that there is a limit of 1024 characters for the maximum length of
a hidden field. In order to specify an output form longer than 1024
characters, you may break it into several hidden fields named
outform1, outform2, outform3, etc. Example:
<input name=outform1 type=hidden value="
Great Big Report
Name: $name
E-mail address: $from
Favorite color: $color
...
">
<input name=outform2 type=hidden value="
Favorite food: $food
Favorite drink: $drink
...
">
Note that both the subject line and the output format can contain the names of other input fields, each preceded by a dollar sign ($). The values input by the user will be substituted for the names of these fields before the mail is sent.
If you use less than (<), greater than (>), ampersand (&), or quote (") characters within your hidden fields, you will have to escape them using ampersand entities in order not to confuse the HTML in your form. This is particularly important if you intend to produce HTML in your yamform output. For example, if your user entered a URL in the field $url and a title in the field $title, you could produce output containing the HTML for a link to the URL as follows:
<input name=outform3 type=hidden value=" <a href="$url">$title</a> ">
<input name=outform4 type=hidden value=" FAVSUM,"$name",$color,$food,$drink ">You can then use the Unix command grep to extract the summary lines from your mailbox file. The details will differ according to the system on which you receive your e-mail. If for example you are user "jroe" on the RUF, then you could extract the lines by logging into your RUF account and typing the following command at the Unix prompt:
grep FAVSUM /var/mail/jroeThe output from the grep command will be in a format suitable for importing into Excel or some other spreadsheet program.
Attention non-Rice users: Please refrain from setting up forms on non-Rice servers which post to the installation of yamform at Rice. If you wish, you may install the yamform source at your site, although please note that it is entirely unsupported by Rice.