// Copyright (C) 1996-2002 by H.E.I. Informationssysteme GmbH and suppliers.
// This file is part of heitml. All licensing conditions of the
// heitml package apply. See the license file contained in the heitml
include heilayout.hei
include mailform.hei
<TITLE>Mailform Example</TITLE>
BODY banner="banner2.jpg"
h1Mailform Example/h1
The mailform library makes the creation of email forms simple and more
powerful than the usual CGI implementation. p
Mailforms are the simplest CGI application and used extremely often. A mail
form is displayed on the screen, e.g. as a reply, request, or order form.
The user can fill out the form and the filled out content is sent
to somebody by email. p
mheitml mail forms are more powerful and simpler to create:
ul
li Creating the form is much simpler than using HTML-form and table
tags explicitly. If you are not convinced, just view the
sa href="emailex.hei" urlpar="$debug=pp" source code /sa.
li You can use the full power of mheitml to format the email letter
li If you wish users can get a cc on the email, can review the email
or even edit it, before it is sent.
li If there was an error filling out the form, ...
no problem the user is shown the form again, with the error marked;
li The full power of mheitml can be used for customization, e.g. send the
email to different people depending on topic, etc.
p
// Specify which fields have to be filled out
mailrequire "Email" mailrequire "Name"
// This is the mailform shown on the screen
mailform labelformat="<b>"
How do you like mheitml ?
// With mailtable fields get lined up nicely in a table
mailfield "FirstName" 20
mailfield "Name" 20
mailfield "Email" 20
mailtextarea "Comment"
// buttons can be placed anywhere in the mailform
p
Do you want to receive a copy of the email ? mailccUserCheckBox checked=true p
mailbutton mailbuttonpreview mailbuttonedit
// mailbuttonpreview shows the user a preview of the email being sent
// mailbuttonedit shows the user an edit window to edit the email
// This is text which is prepared and sent to email address specified
// With <? ff.First> a form field can be inserted in the text
mailtext to="heitml@h-e-i.de" allowedit=true allowpreview=true
mailhead // This will put a head into the email containing the date
mailIntoUserMail // The inner of this will be send to the user as his copy
Thank you again for filling out our feedback form.
This is what you have written.
my name is ? ff.FirstName ? ff.Name.
You can reach me by email: ? ff.Email.
// The following text is shown to the user after the email has been sent
mailsent