December 26th, 2003, 01:25 PM
sending CFform to different recipients based on selection
I would like to set up a form that has radio buttons that based on the selection sends it to a certain recipient. so if
a. = firstname.lastname@example.org
b. = email@example.com
and someone clicks on b. it will send it to Sally.
How would I go about doing this? I am just beginning to learn CF so please take that into consideration as explaining this.
Thanks for your help,
December 26th, 2003, 01:48 PM
Well in your form you'd have something like:
<form action="mailform.cfm" method="post">
<input type="radio" name="mailrecipient" value="firstname.lastname@example.org">Joe<br>
<input type="radio" name="mailrecipient" value="email@example.com">Sally<br>
<input type="submit" value="Send Mail">
And then on the mailform.cfm page where the email is handled, you'd do something like:
<cfmail to="#form.mailRecipient#" from="firstname.lastname@example.org" subject="Your email">
Someone from the site wanted to send you this message.
Hope that helps.
December 26th, 2003, 01:56 PM
Thanks for your help. I'll give it a try right now.