• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Send Multiple emails from a form using CF

New Here ,
Jan 07, 2013 Jan 07, 2013

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

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 08, 2013 Jan 08, 2013

cfmail to="#form.hisEmailAddress#,#form.bossesEmailAddress#,#form.branchEmailAddress#"

After form validation, of course.

^_^

Votes

Translate

Translate
LEGEND ,
Jan 07, 2013 Jan 07, 2013

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.

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2013 Jan 07, 2013

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".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 08, 2013 Jan 08, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 08, 2013 Jan 08, 2013

Copy link to clipboard

Copied

cfmail to="#form.hisEmailAddress#,#form.bossesEmailAddress#,#form.branchEmailAddress#"

After form validation, of course.

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 08, 2013 Jan 08, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 08, 2013 Jan 08, 2013

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.

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 08, 2013 Jan 08, 2013

Copy link to clipboard

Copied

If you give all three email text boxes the same name, they will be submitted as a list.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 08, 2013 Jan 08, 2013

Copy link to clipboard

Copied

LATEST

WolfShade, that works. Thank you!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation