Form E-Mail

A basic script that converts the contents of a form to an e-mail message


How to use the Form->Email Script
  1. Getting started
  2. How to create an input field
  3. Customizing the default subjecting line
  4. Including a form field into the e-mail subject
  5. Making a field required
  6. Customizing the page seen after form completion
  7. Changing the order of your form results
  8. Adding a blind carbon copy (bcc) e-mail address
  9. Specifying a return e-mail address


Getting started
Create an HTML form with the following tags:
  • A standard <form> tag that contains the path to the Form->Email processing script

    <form method= "post" action="http://www.bizland.com/scripts/formemail.bml">
  • A hidden tag. This tag means it cannot be seen by your customers and tells the form where to e-mail the contents of the form.

    <input type="hidden" name="my_email" value="youremail">


How to create an input field
Create an input field for each piece of data you wish to collect
    To create an input field you can use a tag such as this:

    <input type="text" name="fieldname" size="25">

    For example if you wanted to create a input field called fullname it would look like this:

    <input type="text" name="fullname" size="25">


Customizing the default subject line
    You can customize the default subject line by using this hidden tag and replacing subject with what you want the subject to be

    <input type="hidden" name="subject" value="subject">


Including an input field into the e-mail subject line
    If you want to include one of the input fields in the return e-mail's subject field, all you need to do is replace "Subject" in your code with the NAME of the field surrounded by %%.

    For example, if your form contains a field named firstname, it would look like this

    <input type="hidden" name="subject" value="form submission from %%firstname%%">


Making an input field required
    If you want to make a certain input field required in your form. Use the following tag

    <input type="hidden" name="required" value="field1,fieldn">

    For example, if you were making the field named emailadress and firstname, your tag would look like this

    Note: "required" must be in lower-case letters to be recognized by our processor; name="REQUIRED" may not work. <input type="hidden" name="required" value="emailaddress, firstname">


Customizing the pages seen after form completion
You can send your visitors to various URLs after they have completed the form.

  • To send them to a specific page after they have completed the form successfully by using the tag below and replacing "yoururl" with the page name. The URL does not have to be on your site or even hosted with BizLand. It is best to use full path names (http://www.yoursite.com/page.html) and not local paths (/page/html).

    <input type="hidden" name="thankyou_url" value="yoururl">

  • If a customer fills out your form incorrectly, you can customize the "error" page by they see inserting the following line of code in your form:

    <input type="hidden" name="error_url" value="yoururl">


Changing the order of your form results
By default, the results of your form are displayed alphabetically by field name

  • To change this order,you will need to use the following syntax.

    <input type="hidden" name="order" value="field,field2,field3">




Adding a blind carbon copy (bcc) e-mail address
You can have an e-mail address as an blind carbon copy to the results of your form.

  • Use the following syntax to add a bcc e-mail address:

    <input type ="hidden" name ="bcc" value="bbcemailaddress">




Specifying a return e-mail address
Have your customers insert their e-mail address into your form.

  • Use the following syntax to have your customers add their e-mail address:

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