Email Forms & Metafeedback

metafeedback: WWW Feedback Mail Program

metafeedback is a program which allows anyone at Caltech to set up their own feedback form--an HTML form that sends e-mail to someone. All you need to do is write a form with the right names for a few fields. No programming is required. The system is very flexible, so your forms can have as many or few fields as you want.

Your machine must be a Caltech domain in order for metafeedback to work. We do not support non-caltech virtual domains

Step by Step

1. Create a form in an HTML file

First, you must make an HTML file specifying what your form will look like. Your file can contain anything you want, as long as the form is specified correctly.

Recall that forms are specified as
<FORM ACTION="URL"> ... </FORM>

To use metafeedback, specify http://www.its.caltech.edu/cgi-bin/metafeedbackas the URL. This means that, when the form is submitted, it will be sent to the metafeedback program.

After the ACTIONline, you need to tell metafeedback where to send e-mail to. You do this by placing a hidden field in the form, like this:
<INPUT TYPE="hidden" NAME="to" VALUE="my-name@wherever.caltech.edu">

When you submit the form, its contents will thus be sent to my-name@wherever.caltech.edu. You would use your own e-mail address, of course. If you want, you can have more than one address in the VALUE, separated by commas.

Important: the "to" address or addresses must be Caltech email addresses. We do this to avoid the possibility that someone might use metafeedback to do mail relaying or spamming.

Next, specify the rest of the form. There are four fields that you should include:

  • So you know who is sending mail to you, you should include fields named "from" and "name". These should be filled in by an e-mail address and a "real name", respectively. If a non-empty fromfield is not sent to metafeedback, the mail will appear to be from the user the web server process runs as. If you should happen to reply to such an email, your reply may go to the web server administrators and not the person who filled out the form. To prevent this from happening, specify the field as !from, so the person filling out the form is forced to provide a return address.
  • It's a good idea to specify a subject for the e-mail, so you can distinguish among all of the mail that you get; use a field named "subject". If you want the person filling out the form to specify the subject, make this a regular input field; if you want all of the mail coming from this form to have the same subject, make the field "hidden" in the same way as the "to" field and specify the subject in the VALUE part.
  • Finally, you probably want to have a large text box for comments. This field, which will make up the body of the e-mail message, should be named "comments".

Remember that somewhere in the form, you need to have a button to submit the form, like this:
<INPUT TYPE="submit" VALUE="Send this to me">

2. Put the HTML file on an accessible web server

Your file should be located somewhere where it can be accessed from the Web. You can put it in with all of your other HTML documents; it doesn't have to be anywhere special.

3. Go to the file (directly, or make a link)

The HTML file has a URL just like everything else on the Web. In your Web browser, you can go to the URL directly, or you can make a link to it from some other HTML file.

4. Fill out the form

Try out your new form! Fill in the fields and press the "submit" button. You should receive mail in a few minutes. Note that, if you filled in the "from" field correctly, you can simply use the "reply" function of your mail-reading program to respond to the e-mail.

Important: to prevent malicious people from flooding the program with large amounts of data as an attempt to violate security, metafeedback only reads the first 4096 characters in a field - anything after that is discarded.

Other options

There are a few other options that you can specify that change the way that metafeedback works.

  • The most important feature is that you can add any fields you want to the form. Any input fields in the form will be added to the e-mail that gets sent. For example, if I wanted to ask age of the person filling out the form, I could add a field like this:
    <INPUT TYPE="text" NAME="age">
    The input to this "age" field would be mailed to me along with the rest of the form.

    These additional fields will be printed in order of their names in your mail. You may also specify what order they are in: just put numbers at the beginning of the field names. They will be printed without the numbers in your mail. For example, if a form has fields named "1date", "2weekday", and "3time", the fields would be printed out in the order "Date", "Weekday", and then "Time".

  • You can require that the user fill out certain fields in your form by prefacing the name of those fields with an ! (exclamation mark). Here is an example:
    		<INPUT TYPE="text" NAME="!age">
    An important use of this is to force the from variable to be set, so the message appears to be from the person who filled out the form, not the web server user. You'd do that like this:
    		<INPUT TYPE="text" NAME="!from">
  • You can use the field messageStart to have text put in the email message before any other non-header material. This can be used to make forms that subscribe people to majordomo mailing lists as well as sending information to other recipients. To do this this, add majordomo@its.caltech.edu as a recipient to the to field, then add the following HTML to the form:
    		<input type=hidden name=messageStart value="subscribe list-name&#10;--">
    
    substituting the name of the mailing list for list-name. All of the stuff after list-name must be there.

  • If you would rather have a field appear in the email as text with certain lines before and after it, rather than as the text after the field name and a colon, you can do so by defining fields enclose-start-fname and enclose-end-fname, where fname is replaced by the name of your field. If you define a start line but not an end line, the start line will be used as the end line. If you don't define a start line but do define an end line, no enclosing is done.

  • To get more information about the computer and browser that were used to fill out the form, put
    <INPUT TYPE="hidden" NAME="printHostInfo">
    in your form. If you often need this information, it's easier to get the information automatically than to rely on the user (who is often wrong, anyway).

  • Sometimes your mail program may hide the name and e-mail address of the person who sent the mail to you. If you want to make these easier to see, put the fields
    <INPUT TYPE="hidden" NAME="printName">
    <INPUT TYPE="hidden" NAME="printEmail">
    in your form. In the body of your mail you will see the name and/or e-mail address of the person who filled out the form.

  • To print out the time the form was submitted as a data field, add the following to your form:
    <INPUT TYPE="hidden" NAME="printTimestamp">

  • If you want the person filling out the form to provide a valid ITS account username in a field, use the field ITSUsername; if the person filling out the form does not enter a valid username, they will get an error message to that effect. To force the person to provide this information, specify the field as !ITSUsername. (Note that this won't guarantee that the person filling out the form is the owner of that account; it only guarantees that what they put in that field is a valid username.)

  • Normally, after sending the e-mail to you, metafeedback shows the user a standard message saying that the comments have been successfully sent. If you'd like to customize this message, you may give metafeedback the URL of a file to show instead:
    <INPUT TYPE="hidden" NAME="nextURL" VALUE="your URL here">

  • You can replace metafeedback's standard error messages with a URL of your choosing (a single URL used for all errors). To do this, provide metafeedback with the URL to use instead:
    <INPUT TYPE="hidden" NAME="errorURL" VALUE="your URL here">
  • You can add the following to your form:
    <INPUT TYPE="hidden" NAME="delimitedResponse">
    to change the format of the mail message to the following: two lines, the first containing the field names, the second the entered data, both lines having the individual items enclosed in quotes and comma-delimited.

    If you use this feature, multi-line responses will be collapsed into single lines, and any "enclosure" directives will be ignored.