ColdFusion Contact Forms in One Easy File - Part 1 ![[Registration never required for free content]](/images/free.gif)
By: Michael Evangelista on Wednesday, September 17, 2008
Reader Level: 
One of the most common and obvious needs of any professional web developer is the ability to collect information from an HTML form and submit it via email. There are many reasons why this is superior to a simple 'mailto' link, the most important being the ability to hide your actual email address from the ever-more-voracious spambots that plague our online universe (they love to find links like <a href="mailto:me@lotsofspamplease.com"> ... your address becomes a free lunch for the harvester spiders).
In this easy-to-follow tutorial you will learn how to :
- Submit a simple html form with any fields you like via email from any ColdFusion page
- Double-validate submitted info with <cfform> and server-side checking
- Create an automatic custom-formatted mail message
- Send the user a custom-formatted auto-responder 'thanks' message
- Hide your email address from spambots
- Send email so that replying goes to the sender, not back to the web site
...all in one simple <cfinclude> file that you can insert into any page!
This tutorial assumes you have some experience with html form elements, and very basic ColdFusion tags such as <:cfif>, <cfinclude>, <cfparam> and <cfoutput>. A general concept of <cfform> and the 'required' attribute for <cfinput> might also be helpful, but is not required.
Michael Evangelista is a freelance web developer, ColdFusion programmer, and owner of a successful web and print design company based in southern Utah. Michael's company, Evangelista Design, has grown from a locally-oriented small business web design company to an international team of designers and ColdFusion developers offering a wide range of online business solutions, including full-service web hosting, custom content management applications, corporate data systems, and more.
The ColdFusion Contact Forms in One Easy File Series:
ColdFusion Contact Forms in One Easy File - Part 1
ColdFusion Contact Forms in One Easy File - Part 2
ColdFusion Contact Forms in One Easy File - Part 3