#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    15
    Rep Power
    0

    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. = joe@hotmail.com
    b. = sally@hotmail.com
    c. =rupert@hotmail.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,

    Kdiff
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    Well in your form you'd have something like:

    <form action="mailform.cfm" method="post">
    <input type="radio" name="mailrecipient" value="joe@hotmail.com">Joe<br>
    <input type="radio" name="mailrecipient" value="sally@hotmail.com">Sally<br>
    <input type="submit" value="Send Mail">
    </form>


    And then on the mailform.cfm page where the email is handled, you'd do something like:

    <cfmail to="#form.mailRecipient#" from="me@mydomain.com" subject="Your email">
    Someone from the site wanted to send you this message.
    </cfmail>


    Hope that helps.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    15
    Rep Power
    0
    Thanks for your help. I'll give it a try right now.

IMN logo majestic logo threadwatch logo seochat tools logo