The HSC Mail Form Mailer will process any form whose action attribute is pointed at the cfmailer file: [http://hsc.unm.edu/scripts/cfmailform/cfmailer.cfm]. By placing a handful of hidden input objects in your form, a user can click the submit button and be assured that it will end up in your designated inbox. This document will cover those hidden objects that are required and those that are optional so that you can successfully create an HTML email form for your web site.
Let’s build a basic web form:
<h1>Sample Email Form</h1>
<form action="http://hsc.unm.edu/scripts/cfmailform/cfmailer.cfm" method="post">
<!-- Required hidden operators -->
<input type= "hidden" name="recipient" value="you@salud.unm.edu" />
<input type= "hidden" name="subject" value= "Sample Email Form" />
<input type= "hidden" name="redirect" value="http://hsc.unm.edu/mysite/emailsucess.html" />
<!-- Field validation for the user -->
<input type= "hidden" name="sender_required" value="You must enter your email address to submit this form." />
<input type= "hidden" name="yourname_required" value="Enter your name please." />
<input type= "hidden" name="birthday_date" value="Birth date must be an actual date." />
<input type= "hidden" name="birthday_required" value="Birth date is required." />
<!-- Our form in HTML -->
<p>Name: <input type="text" name="yourname" value="" /></p>
<p>Email Address: <input type="text" name="sender" value="" /></p>
<p>Things I like:</p>
<ul>
<li><input name="Things_I_Like" type="checkbox" value="Pie" /> Pie</li>
<li><input name="Things_I_Like" type="checkbox" value="Cake" /> Cake</li>
<li><input name="Things_I_Like" type="checkbox" value="Ice Cream" /> Ice Cream</li>
</ul>
<p>Your birthday: <input name="birthday" type="text" value="" /></p>
<p>Comments:<br /><textarea name="Comment"></textarea></p>
<p><input type="submit" name="submit" value="Send This Form" /></p>
</form>
For the form to work, the following hidden operators need to be completed to send an email.
Optional hidden operators:
Your form can contain any number of elements and widgets to help users successfully send information to you. However, there are a few rules to watch out for.
There are several command words used by the form processor that will help you validate the user input before it is sent by email. You can use them in any combination and stack them. In the example form we have made a date field validate as an actual date and made it a required field.
To create required fields that will stop the email from being sent and alert the user to fix their form follow these steps:
There are several validation types you can use:
When the email is sent, the designated recipient will receive a list of all the fields with the information the user entered. For example, if I answer the form above this sample email will be sent:

Reserved words not to be used in general field names (they have special uses as described above):