Show Includefiles Show Related Doclinks

File: /home/radpage/docroot/heitml2.0/tutor/emailex.hei

// 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

// distribution.

<HTML>

<HEAD>

‹include heilayout.hei

‹include basic.hei

‹include mailform.hei

<TITLE>Mailform Example</TITLE>

</HEAD>

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

     sent.

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;

     not just an error messages.

li The full power of mheitml can be used for customization, e.g. send the

     email to different people depending on topic, etc.

/ul

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

   mailtable

        mailfield "FirstName" 20

        mailfield "Name" 20

        mailfield "Email" 20

        mailtextarea "Comment"

   /mailtable

   // buttons can be placed anywhere in the mailform

   // or just left out

p

   Do you want to receive a copy of the email ? mailccUserCheckBox checked=true p

   mailbutton mailbuttonpreview mailbuttonedit

   //   mailbutton          sends the email

   //   mailbuttonpreview   shows the user a preview of the email being sent

   //   mailbuttonedit      shows the user an edit window to edit the email

/mailform

// 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

allowusercc=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.

/mailIntoUserMail

H(e)i Heitml-Team,

my name is ‹? ff.FirstName ‹? ff.Name.

My comment on heitml is:

‹? ff.Comment

You can reach me by email: ‹? ff.Email.

Best regards,

‹? ff.FirstName

/mailtext

// The following text is shown to the user after the email has been sent

mailsent

Thank you very much for entering your comment.

/mailsent

</b>

/BODY

</HTML>