Site Panel Help User Panel Help Panel Demo's Search Help

Categories

· Show all categories

· New Customer FAQs
· E-Mail
· FTP - File Transfers
· Domains
· SSH and Telnet
· Scripting Languages
· Password Protection
· MySQL
· Stats
· Power Tools

· FAQ Home

· EchoEcho+ Support

XML-File

<?xml version="1.0" encoding="iso-8859-1"
standalone="yes" ?>
<!-- XML-Output by phpMyFAQ 1.3.8 -->
<phpmyfaq
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:NamespaceSchemaLocation="http://www.phpmyfaq.de/xml/faqschema.xsd">
<article id="67">
	<language>en</language>
	<category>Power Tools</category>
	<keywords></keywords>
	<theme>POWERTOOL: FormMail</theme>
	<content
xmlns="http://www.w3.org/TR/REC-html40">WHAT IS A FORM MAILER?
The FormMail is a two step thing:
1: You create a plain HTML page with a form on it. 
2: When the form is sent to the formmail script,
it sends out an email with the contents of the form.




************************************************
INSTALLING THE SCRIPT
************************************************
First you need to install the form mail script:

1: Login to the site owner panel.
2: Click &quot;Power tools&quot; in the left menu
3: Click the &quot;Install this powertool&quot; icon to the
right of
&quot;JackScripts Formmail&quot;
(The icon is a blueish arrow pointing down on a disk)
4: Click &quot;Install&quot; - and you&#039;re done!

You can now use this form mailer whenever you need to send
the contents of
an HTML form to an email address. 

You do not need to install multiple form mailers if you have
multiple
forms. They can all send to the one form mailer you just
installed.

The next step is to setup a form that will send to the newly
installed
formmailer.




************************************************
DEMO ON YOUR SITE:
************************************************
When you install Form Mail - a sample form page,
&quot;demo_html.html&quot;, is created in the same folder as
the script. 

You can see the demo file if you go to: 

http://yoursite.com/formmail/demo_html.html

(Assuming you installed the from mail in the default
&quot;formmail&quot;
folder).

 


************************************************
FORM CONFIGURATION
************************************************

The action of your form needs to point towards formmail.php
(obviously).

ie: &lt;FORM ACTION=&quot;/formmail/formmail.php&quot;
METHOD=POST&gt;




************************************************
REQUIRED FORM FIELD: 
************************************************
There is only one form field that you must have in your
form, for
FormMail.php to work correctly. This is the recipient field.

 
Field: <b>recipient</b>

 
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 e-mail
address. 

Syntax: 
&lt;input type=hidden name=&quot;recipient&quot;
value=&quot;email@your.host.com&quot;&gt;

For Multiple Recipients seperate the emails with commas
(&quot;,&quot;).
 

--------------------------------------------------------------------------------


 

************************************************
OPTIONAL FORM FIELDS:
************************************************

These are the available fields you can use:

<b>recipient (required)
bcc 
subject 
email 
phone_no 
fax_no 
zip_code 
redirect 
require 
required 
attachment 
file 
file2 
env_report 
sort 
title 
missing_fields_redirect 
background 
bgcolor 
text_color 
link_color 
vlink_color 
alink_color 
style_sheet 
ar_file</b> (Auto-Responder Option)
<b>ar_subject</b> (Auto-Responder Option)
<b>ar_from</b> (Auto-Responder Option)
<b>multiple selection fields</b> (how-to below)

Below is a detailed explanation of each field:
 

--------------------------------------------------------------------------------

Field: <b>bcc</b>

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

 
Syntax: 
&lt;input type=hidden name=&quot;bcc&quot;
value=&quot;email@your.host.com,
alias@myhost.com&quot;&gt;

For Multiple Recipients seperate the emails with commas
(&quot;,&quot;).
 

--------------------------------------------------------------------------------
 
Field: <b>subject</b>

 
Description: The subject field will allow you to specify the
subject that
you wish to appear in the e-mail 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: &quot;Form
Submission&quot;
 
Syntax: 
&lt;input type=hidden name=&quot;subject&quot;
value=&quot;subject&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>email</b>

 
Description: This form field will allow the user to specify
their return
e-mail address. If you want to be able to return e-mail 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. The
email address submitted will be checked for validity.
 
Syntax: 
&lt;input type=text name=&quot;email&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>phone_no</b>

 
Description: This form field will allow the user to specify
a phone
number.
The phone number submitted will be checked for validity and
must match one
of the following formats.

123.123.1234 
123-123-1234 
(123)123.1234 
(123)123-1234 
etc.. 
 
Syntax: 
&lt;input type=text name=&quot;phone_no&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>fax_no</b>

 
Description: This form field will allow the user to specify
a fax number.
The fax number submitted will be checked for validity and
must match one of
the following formats.

123.123.1234 
123-123-1234 
(123)123.1234 
(123)123-1234 
etc.. 
 
Syntax: 
&lt;input type=text name=&quot;fax_no&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>zip_code</b>

 
Description: This form field will allow the user to specify
a zip code. The
zip code submitted will be checked for basic validity and
must match one of
the following formats.

12345 
12345-1234 
A1B 2C3 (for candians :P) 
Note: Only Versions 3.0 and higher support Canadian Postal
Codes.
 
Syntax: 
&lt;input type=text name=&quot;zip_code&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>redirect</b>

 
Description: If you wish to redirect the user to a different
URL, rather
than having them see the default response to the fill-out
form, you can use
this hidden variable to send them to a pre-made HTML page or
as another
form type to let the user decide.
 
Syntax: To choose the URL they will end up at:
&lt;input type=hidden name=&quot;redirect&quot;
value=&quot;http://your.host.com/to/ file.html&quot;&gt;

To allow the user to specify a URL they wish to travel to
once the form is
filled out:
&lt;input type=text name=&quot;redirect&quot;
value=&quot;http://&quot;&gt;

Other options include drop down menus and radios etc.. 
 

--------------------------------------------------------------------------------
 
Field: <b>require</b>

 
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.

(To use a customized error page, see
missing_fields_redirect) 
 
Syntax: If you want to require that they fill in the email
and phone fields
in your form, so that you can reach them once you have
received the mail,
use a syntax like:
&lt;input type=hidden name=&quot;require&quot;
value=&quot;email,phone_no&quot;&gt;

You can use this on any field. 
 

--------------------------------------------------------------------------------
 
Field: <b>required</b>

 
Description: Required is an alias for require,

Because I was unaware that Matt Wright used
&quot;required&quot; for the
same purpose I originally used &quot;require&quot;. A lot of
people had
problems with that, so I have made an alias. (Note: this is
only in Version
3.0 or higher.) 

see: require 
 
Syntax: 
&lt;input type=hidden name=&quot;required&quot;
value=&quot;email,phone_no&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>attachment</b>

 
Description: Allows the user attach a file to the email sent
by
Formmail.php.

REQUIRED 

If you are using the attachment option it is crucial to
include the
ENCTYPE=&quot;multipart/form-data&quot; in the form field.
Example Here

RECOMMENDED 

MAX_FILE_SIZE - (case sensitive) hidden field must precede
the file input
field and it&#039;s value is the maximum filesize accepted.
The value is in
bytes. 

Note: This feature was added in version 5.0 
 
Syntax: 
&lt;input type=&quot;hidden&quot;
name=&quot;MAX_FILE_SIZE&quot;
value=&quot;1000000&quot;&gt;

&lt;input type=&quot;file&quot;
name=&quot;attachment&quot;&gt; 
 

--------------------------------------------------------------------------------
 
Field: <b>file</b>

 
Description: Allows the user to upload a file to a path of
your
specification.

REQUIRED 

If you are using the file option it is crucial to include
the
ENCTYPE=&quot;multipart/form-data&quot; in the form field.
Example Here

path_to_file - This is the path which the file will be
uploaded to. Must be
a direct path to your directory. ie:
&quot;/www/yourname/filedir/&quot;

RECOMMENDED 

MAX_FILE_SIZE - (case sensitive) hidden field must precede
the file input
field and it&#039;s value is the maximum filesize accepted.
The value is in
bytes. 
 
Syntax: 
&lt;input type=&quot;hidden&quot;
name=&quot;MAX_FILE_SIZE&quot;
value=&quot;1000000&quot;&gt;

&lt;input type=&quot;hidden&quot;
name=&quot;path_to_file&quot;
value=&quot;/www/dir_where_file_goes/&quot;&gt;

&lt;input type=&quot;file&quot;
name=&quot;file&quot;&gt; 
 

--------------------------------------------------------------------------------
 
Field: <b>file2</b>

 
Description: I received a lot of email asking how to handle
additional file
uploads, I added &quot;file2&quot; to show how easy it is:
Keep the same syntax as above, but append a &quot;2&quot; to
the end of the
file.

Advanced: to add addtional files copy the php functions
(below) that handle
the file upload for file2 and and change the &quot;2&quot;s
to a
&quot;3&quot; or anything else. 


--------------------------------------------------------------------------------
 
Field: <b>sort</b>

 
Description: This field allows you to choose the order in
which you wish
for your variables to appear in the email that Formmail.php
generates. You
can choose to have the field sorted alphabetically or
specify a set order
in which you want the fields to appear in your mail message.
By leaving
this field out, the order will simply default to the order
in which the
browsers sends the information to the script (which is
usually the exact
same order as they appeared in the form.) When sorting by a
set order of
fields, you should include the phrase &quot;order:&quot; as
the first part
of your value for the sort field, and then follow that with
the field names
you want to be listed in the email message, separated by
commas. 
Note: This feature was added in version 5.0 

 
Syntax: To sort alphabetically: 
&lt;input type=hidden name=&quot;sort&quot;
value=&quot;alphabetic&quot;&gt; 

To sort by a set field order: 
&lt;input type=hidden name=&quot;sort&quot;
value=&quot;order:name1,name2,etc...&quot;&gt;


 

--------------------------------------------------------------------------------
 
Field: <b>env_report</b>

 
Description: Allows you to have Environment variables
included in the
e-mail 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. The
following is a short list of valid environment variables
that might be
useful: 

REMOTE_HOST
  - Sends the hostname making the request.
REMOTE_ADDR
  - Sends the IP address of the remote host making the
request.
HTTP_USER_AGENT
  - The browser the client is using to send the request.

 
Syntax: If you wanted to find the remote host and browser
sending the
request, you would put the following into your form:
&lt;input type=hidden name=&quot;env_report&quot;
value=&quot;REMOTE_HOST,
HTTP_USER_AGENT&quot;&gt;

Seperate by commas &quot;,&quot;. 
 

--------------------------------------------------------------------------------
 
Field: <b>title</b>

 
Description: This form field allows you to specify the title
and header
that will appear on resulting pages if you do not specify a
redirect URL.
 
Syntax: If you wanted a title of &#039;Feedback Form
Results&#039;:
&lt;input type=hidden name=&quot;title&quot;
value=&quot;Feedback Form
Results&quot;&gt; 
 

--------------------------------------------------------------------------------
 
Field: <b>missing_fields_redirect</b>

 
Description: This form field allows you to specify a URL
that users will be
redirected to if there are fields listed in the required
form field that
are not filled in. This is so you can customize an error
page instead of
displaying the default.

Note: Version 5.0+ appends a ?error=error message for custom
error
messages. 
 
Syntax: &lt;input type=hidden
name=&quot;missing_fields_redirect&quot;
value=&quot;http://your.host.com/error.html&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>background</b>

 
Description: This form field allow you to specify a
background image that
will appear if you do not have the redirect field set. This
image will
appear as the background to the form results page.
 
Syntax: &lt;input type=hidden name=&quot;background&quot;
value=&quot;http://your.host.xxx/ image.gif&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>bgcolor</b>

 
Description: This form field allow you to specify a
background image that
will appear if you do not have the redirect field set. This
image will
appear as the background to the form results page.
 
Syntax: For a background color of White:
&lt;input type=hidden name=&quot;bgcolor&quot;
value=&quot;#FFFFFF&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>text_color</b>

 
Description: This field works in the same way as bgcolor,
except that it
will change the color of your text.
 
Syntax: For a text color of Black:
&lt;input type=hidden name=&quot;text_color&quot;
value=&quot;#000000&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>link_color</b>

 
Description: Changes the color of links on the resulting
page. Works in the
same way as text_color. Should not be defined if redirect
is.
 
Syntax: For a link color of Red:
&lt;input type=hidden name=&quot;link_color&quot;
value=&quot;#FF0000&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>vlink_color</b>

 
Description: Changes the color of visited links on the
resulting page.
Works in the same way as link_color. Should not be defined
if redirect is.
 
Syntax: For a visited link color of Blue:
&lt;input type=hidden name=&quot;vlink_color&quot;
value=&quot;#0000FF&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>alink_color</b>

 
Description: Changes the color of visited links on the
resulting page.
Works in the same way as link_color. Should not be defined
if redirect is.
 
Syntax: For a active link color of Blue:
&lt;input type=hidden name=&quot;alink_color&quot;
value=&quot;#0000FF&quot;&gt;
 

--------------------------------------------------------------------------------
 
Field: <b>style_sheet</b>

 
Description: Specifies the path to a style sheet (css) that
you would like
to include.(Note: this is only in Version 4.0 or higher.)
 
Syntax: &lt;input type=hidden name=&quot;style_sheet&quot;
value=&quot;style.css&quot;&gt;
 

--------------------------------------------------------------------------------

Auto-Responder Options


 
Field: <b>ar_file</b>

 
Description: This optional field should be the path to your
a text file
which contains your autoresponse text.


 
Syntax: &lt;input type=&quot;hidden&quot;
name=&quot;ar_file&quot;
value=&quot;/www/dir_where_file_goes/autoresponder.txt&quot;&gt;

Note: This is only supported in Version 5.0 or higher.
 

--------------------------------------------------------------------------------
 
Field: <b>ar_subject</b>

 
Description: The ar_subject field will allow you to specify
the subject
that you wish to appear in the auto-response e-mail that is
sent to the
user 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: &quot;Re:
Form Submission&quot;


 
Syntax: &lt;input type=&quot;hidden&quot;
name=&quot;ar_subject&quot;
value=&quot;Thank you for your interest&quot;&gt;

Note: This is only supported in Version 5.0 or higher.
 

--------------------------------------------------------------------------------
 
Field: <b>ar_from</b>

 
Description: The ar_from field allows you to specify which
email address is
the auto-response email is sent from.


 
Syntax: &lt;input type=&quot;hidden&quot;
name=&quot;ar_from&quot;
value=&quot;webmaster@thisserver.com&quot;&gt;

Note: This is only supported in Version 5.0 or higher.
 

--------------------------------------------------------------------------------
 
OTHER

To add multiple selection fields simply append a
&quot;[]&quot; to the end
of a field name. 

ie: (for checkboxes)

    Option 1: &lt;input type=&quot;checkbox&quot;
name=&quot;multi_field[]&quot; value=&quot;option
1&quot;&gt;&lt;br&gt;
    Option 2: &lt;input type=&quot;checkbox&quot;
name=&quot;multi_field[]&quot; value=&quot;option
2&quot;&gt;&lt;br&gt;
    Option 3: &lt;input type=&quot;checkbox&quot;
name=&quot;multi_field[]&quot; value=&quot;option
3&quot;&gt;&lt;br&gt;


ie: (for multiple selection fields)

   &lt;select name=&quot;multi_field[]&quot;
size=&quot;3&quot;
multiple&gt;
    &lt;option&gt;Option 1&lt;/option&gt;
    &lt;option&gt;Option 2&lt;/option&gt;
    &lt;option&gt;Option 3&lt;/option&gt;
    &lt;option&gt;Option 4&lt;/option&gt;
    &lt;option&gt;Option 5&lt;/option&gt;
   &lt;/select&gt; 

------------------------------------------
Based on: http://dtheatre.com/scripts/formmail_doc.php</content>
	<author>EchoEcho Support</author>
	<date>12.07.2009, 21:20</date>
</article>
</phpmyfaq>

open XML-File

Copyright © EchoEchoPlus Hosting