Affordable Web Hosting with Excellent Customer Support internet connection free month hosting

Mailform Support

Mailform allows the webmaster to create an elegant interface that users can use to send form information via email.

The Mailform has a few advantages over a standard <a href="emailto:..."> HTML hyperlink:

  • Security - email addresses that are listed in HTML hyperlink may be stripped and abused by junk-mailers.
  • Accessibility - public-use computers, such as those found in libraries, are often not configured to send conventional e-mail. The mailform allows the users of these facilities to contact you or your clients via e-mail.
  • Consistency - the features of the mailform allow you specify pre-defined texts that make your e-mail more manageable.
  • Get the information you need - perhaps the greatest benefit of using mailform is that you can collect the information that you need. The text fields can be configured to be required so the form will not process unless the information is provided.

Setting up a Mailform

Once you install the Mailform script you can create as many different forms as you wish and they will all function using the one Mailform script.

Mailform Configuration

What follows is a listing of the required and optional HTML tags you should use to create your Mailform. We recommend using only the code you need, and tailoring it to the look and feel of your web-site.

Required Tags

The first tag of your form should look like this:

<form action="/cgi-bin/mailform" method="post">

This line specifies that your form is to be handled by the Mailform script.

The next tag that Mailform requires to function properly appears below. It specifies the email address of the person that will receive the results of the form.

Note: This address must be at the domain name under which Mailform is installed. If you'd like to send the form results to an off-server account you must first create a forwarded email address for the account and specify the recipient to be that forwarding account.

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

After these two tags are included you can then begin writing the fields for the information you'd like from your users. For example, if you wanted to find out someone's favorite color, you would use an input tag like this:

<input type="text" name="fav-color">

Optional Tags

In addition to the tags that are required there are quite a few optional tags you can use to change the way the script works:
Subject There are two methods available for setting the subject of the emails sent by a mailform:
  • The first method specifies a fixed subject that will be used for all of the outgoing mail sent by the mail form. This is helpful for users who wish to have a Mailform set up for a specified service. A user who wanted a special Mailform for "sales" could have the subject set to "Sales."

    To specify a fixed subject, include the tag:

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

  • The second method allows the users of the web-site to specify their own subject using a modifiable text-field.

    To create a subject text-field box, include the following tag:

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

If no subject option is included, then the subject "WWW Form Submission" will appear in the e-mail sent by the mailform.

Redirect The redirect tag allows you to specify a page the user will be redirected to after successfully completing your form. To enable the script to do this simply include the following tag:

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

Sort The sort tag allows you to set the order in which the results are displayed. To add this feature to your Mailform include this tag:

<input type="hidden" name="sort" value="order:field1,field2">

Required Fields The ability to require fields is very helpful when you must gather certain information from your users. To set certain fields as required include the following tag:

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

Keep in mind that if you set any fields required, it's a good idea to use the following tag to let your user know what information was not completed.

Missing Fields Redirect The missing fields redirect allows you to specify a page users will see after attempting to submit your form. This tag only works in conjunction with the required fields tag and it's main purpose is to let your users know that they forgot to provide some required information. The code to incorporate this feature is:

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

In addition to the above optional tags you can use with Mailform, there are also two special input names you can use to add more functionality to your form.

These two special input names are:

  • <input type="text" name="realname">

    If you use this tag, the email you recieve from the form will appear as if it's from the person that filled out the form.

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

    If you use this tag, the email you recieve from the form will have the reply-to address of the person that filled out the form.

Sample Form Code:

Things to Remember

Should a mailform fail to work properly, we recommend that you delete and re-install mailform from the netConsole.

Related Items