Tango Hosting Support

How to Setup a Cold Fusion Email Form

*** Tango Hosting offers the following support file as a courtesy. If you need further assistance with configuration please contact support@tangohosting.com for a price quote. ***

Below is a simple cut and paste solution for a Cold Fusion E-mail form that will e-mail you. After submission, it will redirect the user to a "thank you" page of your choice.

You need only 2 files, and a place to redirect the user when they've submitted the form.

1. The first file contains your form somewhere in your page (e.g. create a file and name it form.htm):

<!-- Cut cobe below this line -->

<form action="mail.cfm" method="post" name="form1">
<br>
<textarea name="comments" cols="35" rows="4">Type comments here</textarea>
<br>
<input name="name" type="text" value="your name">
Name (required)
<br>
<input name="emailaddress" type="text" value="your e-mail">
Reply e-mail address (required)
<br>
<input name="Submit" type="submit" value="Send it">
</form>

<!-- Cut code above this line -->

The 2nd file is the actual CFM file that mails it, "mail.cfm" in this example, containing the following code
(customize the parts in bold to reflect your own information):

<!-- Cut code below this line -->

<cfmail
from="#form.emailaddress#"
to="you@yoursite.com"
subject="From your website"
server="mail.yoursite.com">

#form.comments#
#form.name#
#form.emailaddress#

</cfmail>
<cflocation url="HTTP://www.yoursite.com/thankyou.htm">

<!-- Cut code above this line -->

The cflocation url in the last line is where your user is redirected after the mail.cfm file is executed. The redirect location can be anything. For this example we set the redrect to a file (page) called thankyou.htm.