MOREnet logo
Home | Web Site Management | Managed CMS | Managed LMS | SecondWeb | Manager Application |
 Home >  Web Site Management >  MOREnet Applications >  Matt's FormMail
MOREnet Applications  
  Matt's FormMail  

View the printer friendly version of this document

Using FormMail with Your Hosted Web Site

Revised: June 20, 2016



Matt's FormMail is a popular, common, and stable web site utility for taking web form submissions online and turning them into an email which is delivered to an assigned email address within your organization.

MOREnet provides a version of this script for use by all web sites hosted within the Web Hosting Service. The version made available is the same as the current Matt's Script Archive FormMail version 1.93, with one exception. MOREnet has adapted this script to work for delivery to any account hosted within Web Hosting Service by using a unique ID code for each account. Since each email account is referenced by a unique ID, this has the added benefit of further reducing opportunities for e-mail address harvesting by spammers.

All web sites hosted in the Web Hosting Service can use this version of FormMail. Your site does not need a PHP/Perl Application Server add-on to utilize kSFormMail.

FormMail User Documentation

User documentation for Matt's FormMail is located on the Matt's Script Archive web site. MOREnet has taken care of the installation and configuration for the application itself on the web server. As a web developer or Webmaster for your web site, you should read the "Form Configuration" section of the documentation preparatory to using FormMail.

The Modified Recipient Field

Having read the above Form Configuration documentation, the only change needing to be made is that instead of using the email address of the recipient, you instead use the unique ID for that particular email address.

For example, if the kinetic Service hosted email address of has the unique ID of 7hNAE8.kO3g, then the recipient line in your web page would look as follows:

<input type="hidden" name="recipient" value="7hNAE8.kO3g">
Multiple recipients would be listed by their unique ID's separated by commas:
<input type="hidden" name="recipient" value="7hNAE8.kO3g,3qnnZbYrvw9,c7t4w7Qr/Pg">

Weekly kSFormMail Account Listing E-mail

Each week an email will be sent to the Webmaster email alias account for your organization. This email will contain a listing of all accounts for your organization, plus all email aliases configured for your organization, as of the morning on which the report was generated.

As a further convenience, the listings are in the form of an HTML FORM's SELECT drop-down box, suitable for copying and pasting into a web form to allow visitor's to select the recipient for their web form submission.

<SELECT NAME="recipient">
  <OPTION VALUE="4DdSEueMgCo">Abner, Joe</OPTION>
  <OPTION VALUE="6hNAE7.n33g">Baker, Carla</OPTION>
  <OPTION VALUE="j7DG9H.ud7A">Carlos, Richard</OPTION>
  <OPTION VALUE="o8pN7QNWSBU">Dinobly, Ieleen</OPTION>
Please feel free to adapt or modify the listings as needed for your web site usage.

The Web Form's "action=" Line

To direct the "action=" line of the web page form to use the Web Hosting Service adapted FormMail utility, code the HTML as follows:

<form method="POST" action="/cgi/fm/kSFormMail.cgi">
The above example is the minimal HTML code needed for the "action=" line.

Example "Contact Us" Web Page Form

A common usage on many web sites using FormMail is to create a simple "Contact Us" web page. Follow the below example steps to create a basic yet functional web page which will allow your visitors to select a person from your organization, type in a request or comment, and then submit this in their web browser. FormMail will generate an email which is delivered to the selected recipient along with the submittors question or comments.

  1. Create a file named example-contactUs.html .
  2. Open the file with a text editor or your web page editing software. Paste in the following text:
    <title>Contact Us</title>

    <h2>Contact Us</h2>

    <form method="POST" action="/cgi/fm/kSFormMail.cgi">

    <input type="hidden" name="required" value="subject,comment,name,email">
    <input type=hidden name="redirect" value="http://YOUR-SITES-DOMAIN/thankyou.html">

    Send to:
    <!-- SELECT statement from "Weekly kSFormMail Account Listing E-mail" to go here -->

    <input type="text" name="subject" value="" size="60">

    <textarea name="comment" cols="60" rows="8" wrap="virtual"></textarea>

    Your Name:
    <input type="text" name="name" value="" size="60">

    Your Email Address:
    <input type="text" name="email" value="" size="60">

    <input type="submit" name="Submit" value="Send">
    &nbsp; &nbsp;
    <input type="reset" name="Clear" value="Clear">

  3. Replace the text YOUR-SITES-DOMAIN with the domain name of your web site. For example, if your web site is, replace the text YOUR-SITES-DOMAIN with .
  4. Save the file.
  5. Check the webmaster email for your organization. Alternately, if you do not have access to the email for your organization's webmaster, contact the person who does. Obtain a copy of the most recent Weekly kSFormMail Account Listing E-mail for your organization.
  6. From this email, copy the SELECT statement's lines and paste them into the example-contactUs.html file. Paste the copied lines directly underneath the comment line. When this is done, this section of your file will look similar to the below snippet of HTML code:
    <!-- SELECT statement from "Weekly kSFormMail Account Listing E-mail" to go here -->
    <SELECT NAME="recipient">
      <OPTION VALUE="4DdSEueMgCo">Abner, Joe</OPTION>
      <OPTION VALUE="6hNAE7.n33g">Baker, Carla</OPTION>
      <OPTION VALUE="j7DG9H.ud7A">Carlos, Richard</OPTION>
      <OPTION VALUE="o8pN7QNWSBU">Dinobly, Ieleen</OPTION>
  7. Note that the "Weekly kSFormMail Account Listing E-mail" also includes a separate SELECT statement for any email aliases set up for your organization. You may want to copy selected lines from the email alias listing and insert them where you deem appropriate.
  8. Save the file.
  9. In this example, the Matt's FormMail option for a "redirect" page has been used. Create a second web page named thankyou.html. This web page may contain any appropriate "Thank You" type message you want form submittor's to see after they have submitted the form.
  10. Upload these two files to your web site.
  11. You now have a working example to test in your web browser. Open a web browser and navigate to the example-contactUs.html page. Select yourself from the "Send to:" drop-down selection, fill out the rest of the form, and submit. You will shortly receive an email from your new "Contact Us" web page form.
Feel free to modify, alter, or enhance this form to fit the needs of your web site.

Q: Is There a Way to do Secure (SSL) Form Submissions?

Yes. For some information it may be preferred the form submission be over an encrypted SSL connection. This can be done with a few changes, and added attention to the FormMail "redirect" option.

Prerequisite: Your web site must also have an SSL-encrypted (https) side set up for this to work.

To direct the "action=" line of the web page form to use the FormMail utility for an encrypted SSL submission, code the HTML as follows. Note that this example is the minimal HTML code needed for this "action=" line.

<form method="POST" action="">

Additionally, you should use the FormMail "redirect" option, and the full URL of the web page to be redirected to should be listed.

<input type=hidden name="redirect" value="http://YOUR-SITES-DOMAIN/path/to/thankyou.html">

Not all web form submissions need to be submitted in this fashion. You should give consideration to the sensitivity of the information being submitted. In addition, although the web-based submission is encrypted, the submitted information is then turned into an email and sent to the designated email recipient(s). This email is not encrypted. As such, this method of using FormMail with an encrypted web submission is only of partial value.