| HTML form to e-mail gateway CGI | Written by Kelly Yancey |
MailForm 1.2 Configuration Fields |
MailForm can be used as a generic HTML form to e-mail gateway with just a few restrictions on the HTML form fields and their contents.
HTML Form Configuration:
The action of your form needs to point to where you have installed
MailForm on your web server, and the method must be POST or GET in
capital letters. MailForm offers many ways to code your form to
tailor the resulting HTML page and the way the script performs. Below is
a list of configuration form fields you can use and how to implement them.
Any fields that are not configuration fields are included in the generated
e-mail; multiple fields with the same name are grouped together.
Configuration Form Fields:
Below is a description of all the form fields parsed by the MailForm CGI.
Of these fields, none are required to be in the HTML form except for the
recipient to whom to send the result via e-mail.
Except where specified, if multiple configuration fields with the same name
are given in the HTML form, only one will be used; which one is random.
Typically, you would add these fields to your form as hidden fields. Any form fields
with names not listed here are considered non-configuration fields and
as such, compose the contents of the e-mail that is sent when the user
submits the form.
| Field Name | Description |
| recipient | Allows you to specify the e-mail address you want the form values to be sent to. This field is required. If for some reason you do not want MailForm to send an e-mail message, put the special value "*none*" as the recipient. You can send e-mail to multiple recipients simply by including multiple recipient fields in the HTML form. |
| subject | Allows you to specify the subject of the e-mail message that is sent. |
If you have a form field named email, the value of that field will be used in the return address of the e-mail sent. Unlike most other configuration fields, typically you do not want to hide this form field so that the user can type in their e-mail address. If the email field is listed as a required field (see the required configuration field below) then basic checking is performed to try to ensure that it is a valid e-mail address. |
|
| realname | If you have a form field named realname, the value of the field will be included in the return address of the e-mail sent. Unlike most other configuration fields, typically you do not want to hide this form field so that the user can type in their real name. |
| title | Allows you to set the title of the web page the is generated when the user submits the form. |
| header | Allows you to specify the text that is displayed in the header of the web page that is generated when the user submits the form. |
| background | Allows you to specify a background image to use on the web page that is generated when the user submits the form. This is equivilent to the "BACKGROUND" attribute of the "BODY" HTML tag. |
| bgcolor | Allows you to specify a background color to use for the web page that is generated when the user submits the form. This is equivilent to the "BGCOLOR" attribute of the "BODY" HTML tag. |
| link_color | Allows you to specify the default color of the hyperlinks on the web page that is generated when the user submits the form. This is equivilent to the "LINK" property of the "BODY" HTML tag. |
| alink_color | Allows you to specify the color hyperlinks turn when clicked on the web page that is generated when the user submits the form. This is equivilent to the "ALINK" property of the "BODY" HTML tag. |
| vlink_color | Allows you to specify the color of visited hyperlinks on the web page that is generated when the user submits the form. This is equivilent to the "VLINK" property of the "BODY" HTML tag. |
| text_color | Allows you to specify the color of the text on the web page this is generated when the user submits the form. This is equivilent to the "TEXT" property of the "BODY" HTML tag. |
| font_size | Allows you to specify the size of the font that is used on the web page generated when the user submits the form. This is equivilent to the "SIZE" property of the "BASEFONT" HTML tag. |
| style_sheet_URL | Allows you to specify an external style sheet to be applied to the web page generated when the user submits the form. The style sheet must be in CSS format as defined by the W3 consortium (http://www.w3.org/pub/WWW/TR/REC-CSS1) |
| return_link_URL | Allows you to specify the URL of the return hyperlink on the web page generated when the user submits the form. |
| return_link_title | Allows you to specify the text of the return hyperlink on the web page generated when the user submits the form. |
| redirect | Allows you to specify a full URL to take the user to after submitting the form rather than have MailForm generate a web page. The value must be a full URL, for example, http://www.posi.net/, it cannot be a relative URL. |
| print_config | Allows you to list the configuration form fields you would like to be included in the e-mail sent. Normally configuration form fields are only used by MailForm to affect the way it operates and are not listed with the other non-configuration form fields in the e-mail that is sent. If the "print_config" form field is set, the configuration fields listed as "print_config"'s value are included in the e-mail. The value is a comma-delimited list of configuration form fields to include in the e-mail. |
| env_report | Allows you to list server environment variables that you would like included in the e-mail MailForm generates. The value is a comma-delimited list of server environment variables; typically available environment variables include:
|
| required | Allows you to specify a list of non-configuration fields which must be completed by the user before the results will be e-mailed. The value is a comma-delimited list of non-configuration fields. |
| missing_fields_redirect | Allows you to specify a full URL to take the user to if required fields are missing rather than MailForm generating an error message indicating that they must fill out required fields before submitting. The value must be a full URL, for example http://www.posi.net/, it cannot be a relative URL. |
| sort | Allows you to sort the non-configuration fields as they are displayed to the user when they submit the form and as they appear in the e-mail. The value can be any of the following:
|
| mailheader | Allows you to specify a single mail header to be inserted in the top of the e-mail message. You can include multiple mail headers by including multiple mailheader form fields in the HTML form. This replaces the mailheaders field implemented in MailForm 1.1, allowing mail headers to include a comma which the mailheaders field does not. |
| mailheaders | Allows you to specify a comma-delimited list of mail headers you want inserted in the top of the e-mail message. Obsoleted by mailheader field. |
| set_cookie | Allows you to send a single cookie to the user when they submit the form. The value is the cookie information you want to send them. You can send multiple cookies by putting multiple set_cookie fields in the HTML form. The format of a HTTP cookie is as follows (all on one line, values in brackets are optional):
name=value
[;EXPIRES=dateValue]
[;DOMAIN=domainName]
[;PATH=pathName]
[;SECURE]
name=value is a sequence of characters excluding semicolon, comma and white space.
Wdy, DD-Mon-YY HH:MM:SS GMT
where Wdy is the day of the week (for example, Mon or Tues); DD is a two-digit
representation of the day of the month; Mon is a three-letter abbreviation for the
month (for example, Jan or Feb); YY is the last two digits of the year; HH:MM:SS are
hours, minutes, and seconds, respectively.
|
Return to the MailForm Introduction page