| |
Mail Form Application Components
A mail form is a form that sends the user's input by e-mail to
designated recipients. Mail forms are among the most common Web
applications, as evidenced by the number of Web sites which make use
of them. Mail forms are extremely useful, whether their purpose is to
reply to a message, submit comments about a Web site, request
information, or fill out an order form.
heitml mail forms offer a number advantages over traditional HTML. For
one thing, the mailform component is a lot easier to implement. To
process an HTML form, some sort of scripting language such as PERL must be
used. Though PERL is an easy language to learn, the script itself must be
stored in a separate file, and PERL syntax is different from that of
HTML. Also, most ISPs require you to submit PERL scripts for testing by their
own in-house personnel before allowing them to be placed into production on
your Web site.
heitml email forms share the full power of the heitml forms. You can add many different field
components to a form. They offer various form controls and various ways to
check the field content for consistency. Unlike simple solutions in case of an
error the mailform is redisplayed with the data entered and a useful error
message.
With heitml mail forms you can flexibly define the email text sent,
without editing or changing a program. Other features (that can be activated) are
- a Preview button to display the email generated to the user
- an Edit button to allow the user to edit the email before sending it
- a checkbox where the user can request an email for him/herself
Mail Form Basics
The mailform component sends its data via e-mail.
It provides a way to define mail
recipients, subject, and so on. The mail form can contain field components. The mailformbutton
component provides buttons to send mail, reset the form, and to
preview or edit the mail text. (See the section on
previewing below for details on the latter.)
Component:mailformDetails
Mail forms compose and send e-mail from the form data.
An email form must contains some field components (to enter
some data) and a send button (mailformbutton).
Mailforms usually contain a mailtext component
that defines the text that will actually be sent.
A mailform can contain a preview and/or edit button
so that the user can see or edit the generated email
before sending.
Property |
Kind |
Description |
Oid | Id | Id must be unique within the page. |
To | String(20) | Recipient's e-mail address. |
Cc | String(20) | List of carbon copy recipients, separated by commas. |
Bcc | String(20) | List of blind carbon copy recipients, separated by commas. |
Subject | String(50) | Subject line. |
From | String(20) | Sender's e-mail address. |
Usercopy | Checkbox | Send a copy to the user. A Mailuseraddress
field must be on the form to use this function. |
Method | String(60) | HTTP method to submit the form data set.
Value "post" should be used when form processing causes side
effects, e.g. modifies a database, and if the form contains fieldfileupload.
|
Component:mailformbuttonDetails
Mail form button.
Contents or value are used to render the button.
Property |
Kind |
Description |
Name | String(10) | Button name. |
Layout | String(60) | Input is a standard HTML submit button, image shows an image on the button,
link creates a link (needs JavaScript), compatlink a link or button depending on the browser,
button an HTML4.0 button (must occur just once at end of form),
mbutton an HTML 4.0 button (needs JavaScript), and
compatbutton an HTML 4.0 button or normal button depending on the browser;
|
Value | String(10) | |
Type | String(60) | Select the button's action:
Value "send" sends the mail form's mail.
Value "reset" resets the fields to their initial values.
Values "preview" and "edit" control the mail form's mailpreview
component.
|
Src | String(20) | Image Url, only used for layout=image |
Border | Integer | Border Size, only used for layout=image |
State | String(60) | Is button disabled? |
Assembling the Mail Text
The mail form assembles the mail text from the values entered by the
user. You can use the mailtext component to customize the
mail text. Its content is a template for the mail text, and
the mtf component may be used to insert field values.
Alternatively, you can use the full power of the heitml programming language to
generate the mail text; the variable ff contains the field
values for convenience.
Component:mailtextDetails
Mail form mail text template.
Content is evaluated to compose the mail text.
Use the following components inside the text to insert
form fields and other information into the text
mtfInsert a form field value into the email text.
mtfallInsert all form fields into the email text.
mtfclockInsert date and time into email text.
mtfremoteInsert information on the remote host.
Component:mtfDetails
Insert a form field value into the email text.
Useful inside mailtext component.
Property |
Kind |
Description |
Name | String(10) | Field Name |
Format | String(60) | Formatting |
Component:mtfallDetails
Insert a table of all form field names and values
into the email text.
Useful inside mailtext component.
Component:mtfclockDetails
Insert date and time into the email text.
Component:mtfremoteDetails
Insert information on the remote host into the email.
Property |
Kind |
Description |
Showip | Checkbox | Include IP address |
Previewing the Mail Text
The mailpreview component provides a preview panel. Its
content is hidden until the user presses a preview or edit button.
The mailtextarea component should be used to display the
content of the mailtext. Aside from that, arbitrary markup is possible,
and a reset button cancels the preview panel.
Component:mailpreviewDetails
Sub-panel to preview or edit a mail form's mail text.
Property |
Kind |
Description |
Oid | Id | Id must be unique within the page. |
Component:mailtextareaDetails
Mail form text preview/edit field, use within the mailpreview component.
Property |
Kind |
Description |
Rows | Integer | Area height in characters. |
Cols | Integer | Area width in characters. |
Wrap | String(60) | Control automatic wrap in edit mode. |
Format | String(60) | Formatting in preview mode |
Env | String(60) | Text Block Formatting in preview mode |
Sending a Copy to the User
The mailuseraddress component is a field component which
allows the user
to request that a copy of the e-mail be sent to the e-mail address
entered in that field. In addition the Usercopy checkbox
in the mailform component must be checked.
Caution!
Nothing prevents a
malicious user from entering any e-mail address he wants, tricking you
into sending unsolicited mail to third parties. This is considered
offensive by most people, and may be illegal in some countries. This could
get you in really, really deep trouble, if you allow the user
to edit the content of the mail, too.
|
Component:mailuseraddressDetails
Mail form field for user's mail address.
Property |
Kind |
Description |
Name | String(10) | Field name. |
Size | Integer | Field size in characters. |
Value | String(20) | Initial field value. |
Mandatory | Checkbox | Check to require the user to fill out the field. |
Descr | String(20) | A description of the field value. |
Errmsg | String | An error message that is shown if the user enters a wrong value. |
State | String(60) | Is field disabled? |
Mail has been Sent, What Now?
You can use the mailsent component to display an
acknowledgment after the mail has been sent. Optionally, the mail form
itself can be hidden, so that only the acknowledgment is visible.
Component:mailsentDetails
Contents is displayed after the mail form sent mail.
Property |
Kind |
Description |
Hideform | Checkbox | Check this box to hide mail form after mail has been queued. |
Showtext | Checkbox | Check this box to show the text for editing. |
Programming
You can program an email form to perform various checks
on the data entered. See mailform and .
This page was dynamically generated by the
web application development tool RADpage
of H.E.I.
Try the AJAX Article
(in German) on www.h-e-i.de.
© 1996-2025 H.E.I. All Rights Reserved.
|