Instead of using formmail, or other public script, you can also use ColdFusion if your host provides support for ColdFusion scripting. To create an form that uses ColdFusion (CF) to e-mail also lets you further store the information from the form in a table if you would like.
This tutorial assumes you have a basic understanding of ColdFusion and how it is used in NOF. To briefly refresh, ColdFusion variables are delimited by pound signs before and after the variable. When the CF interpreter sees these signs, it will evaluate these variables as the page is being constructed. Any other text will be sent to the browse as is.
To get started, you'll need to create 2 pages. The first page will contain your e-mail form, the second will contain the CF code to e-mail. In this example, we will create a form that registers a user for the club newsletter.
Be sure to name your fields in your form with meaningful names, NOF defaults to "FormsEditField99" for it's own internal use. Your form should call the second page you created to do the processing.
On the second page, you'll need to create a text box. Then inside this box, you will put your CF code.
This code begins with <CFDIRECTIVE>. This CF tag allows you to suppress all white space between the start and end tags. Since that would CRAM our information together, we do want to suppress that, so we say NO. Then we begin to build the e-mail message using CFMAIL. The code inside the text box displays the necessary code to produce the e-mail.
When you have the e-mail set up as you would like, press OK to save it.
Remember to go back to Site View and rename the file with the .cfm extension so that the ColdFusion interpreter on the host will recognize the page as a CF page. The page with the form also should be name with the .cfm extension so that CF can manage the form variables that are created and used.
Generate your pages. To see how it looks though, you will not be able to view it under Preview or Local Publish mode alone, you will either have to view it through a web server interface that is running ColdFusion or on your host ("//localhost/newsletter.cfm").
On a local system, you will need to have ColdFusion installed and running AND either IIS (or outdated: PWS) Web Server installed and running to do view this. If you do not have these running locally, you can test by uploading to your host and then viewing the pages.
This tutorial was written by and is maintained by Tami Burke