TrueForm Mailer - The Magic Form Mailer script

What makes TrueForm Mailer different from other form scripts?
TrueForm Mailer magically retrieves a copy of any form using it and processes it into a template for the confirmation screen and for email messages.
With TrueForm Mailer you always receive the original form exactly as filled out, without needing templates and complicated software programming anymore.
You may use TrueForm Mailer from any form, without any configuration neccessary. Just point the form's action to TrueForm Mailer!
TrueForm Mailer is fully compatible with Matt's famous and original form mailer.
What you see is what you get! Check it out with this sample form.

Sample Form for TrueForm Mailer

Form Recipient eMail address

Name (for this test)
eMail address
language TrueForm Mailer
Remarks
TrueFM is a professional piece of software which saves a lot of time and money plus it improves the looks of your website.
You may purchase TrueFM for only 36 EURO.

This is the code for the sample form used above:


<h2>Sample Form for TrueForm Mailer</h2>

<form action = "/Mailer/index.php" method="POST" >

<table>
<tr>
<td>Form Recipient eMail address</td>
<td><input name="recipient" type="text" size=25 value="" comment="(This is normally a hidden variable)"></td>
</tr>

<tr><td colspan="2"><hr></td></tr>

<tr>
<td>Name (for this test)</td>
<td><input type="text" size=25 name="realname" value=""></td>
</tr>

<tr>
<td>eMail address</td>
<td><input size=25 maxlength="40" name="email" value=""></td>
</tr>


<tr>
<td>language TrueForm Mailer</td>
<td><SELECT name="language"> <OPTION value="en">en<OPTION value="de">de<OPTION value="id">id</SELECT></td>
</tr>


<tr>
<td>Remarks</td>
<td colspan="2"><textarea rows="3" id="Remarks" name="Remarks" cols="44">I like TrueForm Mailer!!!</textarea></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Send (test)"></td>
</tr>
</table>

<input type="hidden" name="required" value="recipient,realname, email">
<input type="hidden" name="env_report" value="yes">
<input type="hidden" name="subject" value="Sample Form for TrueForm Mailer">
<input type="hidden" name="bcc" value="Office@hivetec.net" comment="this informs us about usage of this test form!">
<input type="hidden" name="FormTest" value="Sample of custom Hidden Variable">
<input type="hidden" name="submit_confirmation" value="This form has been sent">
<input type="hidden" name="http_referer" value = "https://hivetec.net/Mailer/index.php" comment="used to locate this form and make http-referer information obsolete">

<!-- comment: This form has some intentional format glitches to test tolerance-->
</form >

Please follow the instruction from the manual below:

Manual

TrueFM
TrueFM is a universal web form processor and form to eMail gateway.
There is no required form input tag which must be specified in order for this script to work with your existing forms.
Embedded comments or hidden configuration fields can also be used to enhance the operation of FormMail on your site.
TrueFM is auto-detecting and handling 3 languages: English, Deutsch and Bahasa Indonesia
What makes TrueForm Mailer different from other form handling scripts?
TrueForm Mailer magically retrieves a copy of any data input form accessing it and processes it into a template for the confirmation screen and for email messages.
With TrueForm Mailer you always receive the original form exactly as filled out, without needing templates and complicated software programming anymore.
You may use TrueForm Mailer from any form, without any configuration neccessary. Just point the form's action to TrueForm Mailer!
For compatibility, TrueForm Mailer is fully downward compatible with Matt Wright's famous and original form mailer.
What you see is what you get!


COPYRIGHT NOTICE
Copyright (c) 2003-2013 Harry Bleckert, distributed by hivetec UG, All Rights Reserved.

TrueFM is commercial software and may NOT be used and modified free of charge by anyone.
Click here and read the LICENSE AGREEMENT.
By using this code you agree to indemnify the author from any liability that might arise from its use.
Selling the code for this program without prior written consent is expressly forbidden. In other words, please ask first before you try and make money off of my program.
Obtain permission before redistributing this software over the Internet or in any other medium. In all cases copyright and header must remain intact

If you run into any problems while trying to configure this scripts, help is available.
The steps you should take to get the fastest results, are:
1) Read this file thoroughly.
2) Consult the TrueFM Script Distributor for Frequently Asked Questions:
3) If you are still having difficulty installing this script, contact hivetec
Include any error messages you are receiving and as much detail as you can so we can spot your problem.
Also include the variable configuration block that is located at the top of the script.

Hopefully we will be able to help you solve your problems. Thank you
The original form with received data visible will be mailed back to you and displayed on the resulting page if you do not have the forward field set.
There is no limit as to how many other form fields you can use with this form, except the limits imposed by browsers and your server.
Some of the possible uses of this script are:

1) You want to have a form that will be mailed to you, but aren't sure how to write the CGI script for it.
2) You are the webmaster of your site and want to allow users to use forms, but not to have their own cgi-bin directories, which can cause security risks to your system. You can set this script up and then allow all users to run off of it.
3) Want to have one script to parse all of your html forms and mail them to you.


Form Configuration:

The action of your form needs to point towards this script (obviously), and the method must be POST or GET in capital letters.
TrueFM offers many new ways to code your form to tailor the resulting HTML page and the way the script performs.
Below is a list of form fields you can use and how to implement them.

Necessary Form Fields:

There is only one form field that you need to have in your form, for FormMail to work correctly.
This is the recipient field. If this field is undefined, confirmation mail will be sent to your Webserver's Webmaster
i.e. Webmaster@BaliService.com

Field: recipient

Description: This form field allows you to specify to whom you wish for your form results to be mailed.
Most likely you will want to configure this option as a hidden form field with a value equal to that of your eMail address.

Syntax:
<input type=hidden name="recipient" value="email@your.host.com">

Recommended Optional Form Fields:

Field: http_referer

Description: This defines the complete URL (address) of the form calling TrueFM.
It may be used to replace your server's environment variable with the same name.
It is required if a client's browser has referer information disabled and therefore recommended to utilize this field to store the form's address.
Syntax: <input type=hidden name="http_referer" value = "http://BaliService.com/contact_form.html">

Field: email

Description: This form field will allow the user to specify their return
eMail address. If you want to be able to return eMail to your
user, I strongly suggest that you include this form field and
allow them to fill it in. This will be put into the From:
field of the message you receive. If you want to require an
email address with valid syntax, add this field name to the
'required' field.

Syntax:
<input type=text name="email">

Field: subject

Description: The subject field will allow you to specify the subject that you
wish to appear in the eMail that is sent to you after this form
has been filled out. If you do not have this option turned on,
then the script will default to a message subject: WWW Form
Submission

Syntax:
If you wish to choose what the subject is:
<input type=hidden name="subject" value="Your Subject">

To allow the user to choose a subject:
<input type=text name="subject">

Field: realname

Description: The realname form field will allow the user to input their real
name. This field is useful for identification purposes and will
also be put into the From: line of your message header.

Syntax:
<input type=text name="realname">


Optional Form Fields:

Field: language

Description: The language for TrueFM information like error messages.
Use the ISO standard i.e. "en" for English, "de" for German etc.

Syntax: <input type=hidden name="language" value = "http://BaliService.com/mailer/footer.inc">

TrueFM supports three types of field validation.

The first is standard required field validation. With this type of validation, TrueFM only checks to see if a value was entered in the field.

Field: required

Description: You can now require for certain fields in your form to be filled in before the user can successfully submit the form. Simply place all field names that you want to be mandatory into this field. If the required fields are not filled in, the user will
be notified of what they need to fill in, and a link back to the form they just submitted will be provided.


Syntax:
If you want to require that email and phone fields in your form must be filled, so that you can reach the user once you have received the mail, use a syntax like:

<input type=hidden name="required" value="email,phone">

The second type of validation is text data validation.

With this type of validation, you have the option of specifying the minimum and maximum length of the string.

The third type of validation is numeric range validation.

With this type of validation, you have the option of specifying the minimum and maximum value of the number. Also, f2m checks to make sure only digits or a period are entered in the field.

Validation is easy with TrueFM.
To use validation, include an HTML comment as below inside your web form.
The layout of the comment is described below.

Example for data validation:

<!-- REQUIRED FIELDS
Field: Name; Type: TEXT; MinLength: 3; MaxLength: 45; ErrorDesc: The <b>Name</b> is invalid;    //line2
Field: Age; Type: Number; MinValue: 18; MaxValue: 120; ErrorDesc: The <b>Age</b> is invalid.;    //line3
Field: Comment; ErrorDesc: The <b>Comment</b> field is required.;    //line4
/REQUIRED FIELDS -->

The first line above is the beginning of the comment. The format of this line must be exactly as it appears above.

Line 2 defines that the Name field is required, type text and must be between 3 and 45 characters long.
If the Name field doesn't meet these requirements, then the ErrorDesc is displayed.

Line 3 defines that the Age field is required, type number and must be between 18 and 120.
If the Age field doesn't meet these requirements, then the ErrorDesc is displayed.

Line 4 defines that the Comment field is required. If the Comment field is empty, then the ErrorDesc is displayed.

The last line above is the end of the comment. The format of this line must be exactly as it appears above.

Each line of the comment corresponds to a single required field.
Each attribute is expected in the format of name colon value semi-colon.
All attributes except Field are optional. The Field attribute must be included.
Any number of fields may be required, just place the appropriate lines in the comment.
The field names are case sensitive and must appear exactly as they do in the name attribute of the corresponding form element.


Field: submit_confirmation



Description: You may enter a text that replaces the value of the submit button in the form received.

Syntax:

<input type=hidden name="submit_confirmation" value="Order receipt confirmed">

Field: env_report

Description: Allows you to have Environment variables included in the
eMail message you receive after a user has filled out your
form. Useful if you wish to know what browser they were using,
what domain they were coming from or any other attributes
associated with environment variables.

Syntax:
set 1 for report, omit or set 0 if you dont want the report.<br>
env_report defaults to 0, meaning no report.

<input type=hidden name="env_report" value="1">

Field: reply

Description: This field initiates an automated courtesy reply to the user
to thank them for filling out your form.<br>
The default value is "yes", sending a reply automatically if the field "email"
is defined.

Syntax:
<input type=hidden name="courtesy_reply" value="yes">

Field: reply_title

Description: This form field allows you to specify the title and header that
will appear on the processed form page if you do not specify a
forward URL.

Syntax:
If you wanted a title of 'Feedback Form Results':
<input type=hidden name="reply_title" value="Feedback Form Results">

Field: reply_text

Description: The courtesy reply text

Syntax:
<input type=hidden name="repl_text"
value="Thank you for taking the time...">


Field: reply_who_we_are

Description: Tell the visitor who you are in the courtesy reply footer

Syntax:
<input type=hidden name="reply_who_we_are"
value="The Bali Service Provider">


Field: reply_our_url

Description: If you want to put your url in the footer of the reply

Syntax:
<input type=hidden name="reply_our_url"
value="http://BaliService.com">


Field: reply_our_email

Description: If you want to put your mailto in the footer of the reply

Syntax:
<input type=hidden name="reply_our_email"
value="Sales@BaliService.com">


Field: return_link_url

Description: This field allows you to specify a URL that will appear, as
return_link_title, on the following report page. This field
will not be used if you have the redirect field set, but it is
useful if you allow the user to receive the report on the
following page, but want to offer them a way to get back to
your main page.

Syntax:
<input type=hidden name="return_link_url"
value="http://your.host.com/main.html">


Field: return_link_title

Description: This is the title that will be used to link the user back to the
page you specify with return_link_url. The two fields will be
shown on the resulting form page as:

<ul>
<li><a href="return_link_url">return_link_title</a>
</ul>

Syntax:
<input type=hidden name="return_link_title"
value="Back to Main Page">


Field: refresh

Description: This form field will allow you to forward to another url.
If refresh is > 0, the client will be forwarded to return_link_url after n seconds.
This uses metatag "refresh".

Syntax:
<input type=hidden name="refresh"
value="3">


Field: retrieve_tag

Description: The html tag used to retrieve the part of the original form page used to show the processed form.
This defaults to "form", retrieving the form part of the form page only.
You may use any other tag to mark the part of your form page you want to retrieve.
Example:
<TrueFM> ....here is your page code including <form>...</form> </TrueFM>

Syntax:
<input type=hidden name="retrieve_tag" value = "form"> or, following our example:
<input type=hidden name="retrieve_tag" value = "TrueFM">

Field: body_tag

Description: The contents of a body tag used for the processed form.
Example:

Syntax: <input type=hidden name='body_tag' value = 'bgcolor="#CCCCCC" text="#000000" link="#FFFF33"'>
remark: not the single quotes above!

Field: Content_Type

Description: The Content Type for html header and mail header.

Syntax: <input type=hidden name="Content_Type" value = "text/html; charset=iso-8859-15">

Field: header

Description: The complete URL where a file containing the desired header section
may be found that you want to be used for the processed form.

Syntax: <input type=hidden name="header" value = "http://BaliService.com/mailer/header.inc">

Field: css

Description: The complete URL where a CSS stylesheet definition file is located

Syntax: <input type=hidden name="css" value = "http://BaliService.com/css/default.css">

Field: footer

Description: The complete URL where a file containing the desired footer section
may be found that you want to be used for the processed form.

Syntax: <input type=hidden name="footer" value = "http://BaliService.com/mailer/footer.inc">

Field: empty_checkbox

Description: The return value to show for empty checkboxes without value.
This defaults to "0", but you may find "No" or others more handy.

Syntax: <input type=hidden name="empty_checkbox" value = "0">

Field: session

Description: The session id being used by the form if available
This will be posted when calling the form.
Syntax: <input type=hidden name="css" value = "http://BaliService.com/css/default.css">

Field: append_db

Description: If you wish to append the form fields to a flat file database, just specify the filename as the value of this field.
The value should specify the path and file to hold the data.

The Form Maile does automatically create the database file if not exisiting. The data file and the directory containing it must have world write permissions
(Unix 662) to allow the server (which typically runs with no special privs) to append to the file.

When specifying the datafile, it can be either a full unix path (e.g. /home/users/smith/public_html/cgi-bin/data/datafile.dat") or a relative path (e.g. "./data/datafile.dat").
It is important to note that if you specify a relative path, it is usually the path relative from the CGI-BIN directory. You CANNOT specify a URL such as "http://www.myserver.com/cgi-bin/data.dat".

Syntax:
<input type=hidden name="append_db" value="./formdata/InfoSheet.dat">

Field: db_fields

Description: Specify exactly which fields are appended to the database.
Any field not specified in db_fields will not be appended to the
database.

Syntax:
<input type=hidden name="db_fields" value = "realname,email,homephone">

Field: db_delimiter

Description: The separator character between fields in the database.
avoid using common characters, like @.

Syntax:
<input type=hidden name="db_delimiter" value = "|">

Field: cc

Description: This form field will allow you to send a copy of the users
form data to another address instead of putting multiple
addresses in the recipient field. This will be added to
the eMail as a Cc: field.

Syntax:
<input type=hidden name="cc" value="webmaster@infosheet.com">

Field: bcc

Description: This form field will allow you to send a blind copy of the
users form data to another address instead of putting multiple
addresses in the recipient field. This will be added to
the eMail as a Bcc: field.

Syntax:
<input type=hidden name="bcc" value="webmaster@infosheet.com">

Field: forward

Description: If you wish to forward the user to a different URL, rather than
having them see the default response to the processed form, you
can use this hidden variable to send them to a pre-made HTML
page.

Syntax:
To choose the URL they will end up at:
<input type=hidden name="forward" value="http://your.host.com/to/file.html">

To allow them to specify a URL they wish to travel to once the form is filled out:
<input type=text name="forward">


Setting Up the FormMail Script:

The script does not have to be extensively configured in order to work.
There are only two variables in the php script file which you will need to define along with changing the top line of your script to match the location of you PHP interpreter.

Necessary Script Configration:

No configuration is neccessary.
You may change the variables listed below:

referers = array('BaliService.com','64.29.16.20');
This array allows you to define the domains that you will allow forms to reside on and use your FormMail script. If a user tries to
put a form on another server, that is not BaliService.com, they will receive an error message when someone tries to fill out their form.

By default this array is always set to match the server on which this script resides, so you do not need to change anything, unless you want to allow usage from other websites.

By placing BaliService.com in the referers array, this also allows www.BaliService.com, ftp.BaliService.com, any other http address
with BaliService.com in it and BaliService.com's IP address to access this script as well, so no users will be turned away.

Your FormMail program is now configured.

History of major releases:

Version 1.0 18/05/2003 - The preRelease version of TrueForm Mailer was completed!
Version 2.0 12/02/2004 - TrueFM Release Version 2.0
Version 4.0 15/09/2005 - TrueFM Release Version 4.0
Version 7.0 15/09/2011 - TrueFM Release Version 4.0
Version 9.0 03/09/2013 - TrueFM Release Version 9.9


TrueForm Mailer 14.07 - © 2003-2024 by hivetec