[an error occurred while processing this directive] [an error occurred while processing this directive]

mailform details
spacer

contents

  1. abstract
  2. quick summary
  3. premise
  4. purpose
  5. the FORM action directive
  6. the HIDDEN input directive
  7. supported HIDDEN input directives
  8. recommended INPUT tags
  9. examples of MailForm
abstract

This service is intended to provide a campus-wide WWW form -- Email gateway by allowing the contents of any HTML Form (once filled out) to be sent to a campus email address specified by the form owner.

There are just a few restrictions on the HTML Form and what they have to have in them.

premise

Creating an HTML form involves a number of steps which can be needlessly difficult for a web author. Not only do you have to design the HTML code for the form, but you also have to write a CGI program to process the form once it is submitted.

There is no need for a web author who wants to create HTML forms to have to learn how to write CGI programs. Considering that most web authors want the data that users submit via HTML forms to be mailed to a particular address, it would make sense to create a general program that was capable of performing this function on any form that was sent to it.

purpose

MailForm allows web authors to create HTML forms without having to write a cgi-script to process the form. MailForm will process all the input tags sent to it from an HTML form and mail them to an address specified in the form. This address, along with Subject, CC, and BCC addresses can all be specified in the form so that MailForm will work with any form.

the FORM action directive

The form action directive is used to begin an HTML form. It tells the browser which CGI program to run and what method to run it as. To use SU's MailForm, your form directive should look like this:

<form action="http://www.syr.edu/cgi-bin/mailform" method="POST">

the HIDDEN input directive

MailForm is able to be both simple and flexible through the use of the hidden input directive. The hidden tag allows for the author of the HTML form to include information in the form that is not seen by nor altered by the user of the form. It is in this manner that the author of the form gives MailForm its commands.

It is important that the input directives that are used to send commands to MailForm are set to type hidden. If they are not then a user of the form would be able to change the commands and cause MailForm to do something that the author did not intend. No user authentication will be performed by AnyForm, so allowing a user to specify the address to mail the results to would not be prudent.

supported HIDDEN input directives

In your form to be processed by MailForm, the following input directives have special meaning:

  1. MailFormTo
    This is whom the form's contents will be sent to after they have been decoded.

    The following example directive sets MailFormTo to "webmaster@www.syr.edu".
    <input type="hidden" name="MailFormTo" value="webmaster@www.syr.edu">

    This hidden directive is required. Without this directive the form will not work.

  2. MailFormSubject
    This will relay the subject of your form to the script. The subject field will appear as the subject in the mail that you receive.

    The following example sets the MailFormSubject to "Just a Test".
    <input type="hidden" name="MailFormSubject" value="Just a Test">

    This hidden directive is not required. You may create different HTML forms with different MailFormSubject values.

  3. MailFormCc
    The MailFormCc directive tells MailForm any addresses to include on the Cc line in the mail message.

    The following example directive sets MailFormCc to "BigCheese@nil, LittleCheese@null", which will cause MailForm to send copies of each messages to these addresses in addition to that specified by "MailFormTo".
    <input type="hidden" name="MailFormCc" value="BigCheese@nil, LittleCheese@null">

    This hidden directive is not required.

  4. MailFormBcc
    The MailFormBcc directive tells MailForm any addresses to include on the Bcc line in the mail message. Recall that the Bcc line causes copies to be mailed without notifying the other recipients.

    The following example directive sets MailFormBcc to "BigCheese@nil, LittleCheese@null", which will cause MailForm to send copies of each messages to these addresses in addition to that specified by "MailFormTo".
    <input type="hidden" name="MailFormBcc" value="BigCheese@nil, LittleCheese@null">

    This hidden directive is not required.

recommended INPUT tags for MailForm

The INPUT HTML tag is used to specify a simple input element inside a FORM. It is a standalone tag; it does not surround anything and there is no terminating tag.

There are 2 additional variable names, namely, MailFormUserEmail and MailFormRealName, which have special significance to MailForm and are best set by the form user via the INPUT tag. They are best utilized with an attribute type of "text".

  1. MailFormUserEmail

    The MailFormUserEmail directive is used by MailForm to create From: and Reply-To: fields in the mail message. This is helpful if you want to be able to reply to a user. Use a regular text input tag for this to allow the user to fill in his Email address.

    This is a general example of using the INPUT HTML tag for MailFormUserEmail. This allows the user to input his/her own email address.
    <input type="text" name="MailFormUserEmail">

    This directive is recommended but not required. Do not make it hidden.

  2. MailFormUserName
    The MailFormUserName directive is used by MailForm to include the user's real name in the mail message. It's helpful if you wish to know the user's actual name. Use a regular text input tag for this to allow the user to fill in her name.

    This is a general example of using the INPUT HTML tag for MailFormUserName. This allows the user to input his/her own name.
    <input type="text" name="MailFormUserName">

    This directive is recommended but not required. Do not make it hidden.

examples

Ten examples are available. All of the examples use MailForm. They have been modified from a general description of Fill-Out Forms at NCSA

You may wish to use these example forms as templates by viewing the source and performing a 'Save As' command. Once you've saved a copy, modify it to include your own Email address by changing the MailFormTo hidden directive.

  • Example 1 -- a ludicrously simple fill-out form.
  • Example 2 -- three text entry fields.
  • Example 3 -- text entry fields and checkboxes.
  • Example 4 -- changing the default values of text entry fields and checkboxes.
  • Example 5 -- changing various attributes of text entry fields.
  • Example 6 -- multiple, independent forms in a single document.
  • Example 7 -- radio buttons, "one of many" behavior.
  • Example 8 -- option menus.
  • Example 9 -- scrolled lists with single and multiple selections.
  • Example 10 -- multiline text entry areas.
Send comments to SyraCWIS (webmaster@help.syr.edu).