Copy link to clipboard
Copied
Is it possible to build a form so that when submit is clicked an email gets sent to two preselected email address and to a third email address that the user has selected from a drop down using CF?
We are not allowed to use PHP and I'm fairly new to CF.
Thank you
cfmail to="#form.hisEmailAddress#,#form.bossesEmailAddress#,#form.branchEmailAddress#"
After form validation, of course.
^_^
Copy link to clipboard
Copied
Yes. You can put all email addresses into the "to" attribute of the CFMAIL tag, or in the "cc" or "bcc" attribute. I believe they need to be separated by a semi-colon, if there is more than one email address in any attribute.
^_^
Copy link to clipboard
Copied
With cfmail, email addresses can be separated by commas. I think the easiest way to do this is to create a list of the two fixed addresses and append the form value to it.
Google is your friend. Your search string is "ColdFusion ListAppend".
Copy link to clipboard
Copied
Thanks for the input. The part that is confusing for me is since this is in a form, the user types in his/her name, address, phone number... and then they come to a textbox and he/she needs to type in his/her email address and the next text box we need the bosses email address. After those are filled in the user comes to a dropdown box where they are asked to select one of a dozen branch locations they belong to. Say they select the San Antonio branch. The value for San Antonio equals an email address say sa@mybranch.com. So the real question is/ should have been ...How would I create the code using CF so that once the "Submit" button is click, an email is sent, (contaning the input info from the form) to the users,the users bosses email address and to the branch the user selected from the dropdown. I can come close to making it work using ASP but I'm trying to push CF here and like I said I'm fairly new to CF.
Thanks again.
Copy link to clipboard
Copied
cfmail to="#form.hisEmailAddress#,#form.bossesEmailAddress#,#form.branchEmailAddress#"
After form validation, of course.
^_^
Copy link to clipboard
Copied
This makes sense but, the drop-down has a dozen different possibilities ...How can I tell CF to send an email to just the one email (not the other 11), the user selected from the drop-down box, as well as the other emails addresses the user has entered? We don't want the other branches to have the users info. Actually, the info submitted by the users will have nothing to do with the other branches so they don't need the info.
Thanks again, I apologize for being clear as mud
Copy link to clipboard
Copied
Whichever email is selected is the only email from that SELECT that will be added. The other 11 will be ignored.
^_^
Copy link to clipboard
Copied
If you give all three email text boxes the same name, they will be submitted as a list.
Copy link to clipboard
Copied
WolfShade, that works. Thank you!!