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

cfmail sending to first email address in query only

New Here ,
May 05, 2016 May 05, 2016

Copy link to clipboard

Copied

When attempting to send an email to multiple recipients using Cold Fusion, only the first row is receiving the email and it seems to be being hit three times but only sending once. This works but all recipients are visible and the cfoutput is displayed as many times are there are recipients:

<cfmail to = "#ValueList(getEmail.Schd_Email)#" from="test@test.edu" subject="This is a Test" type="HTML" query="getEmail" failto="test@test.com"> The location has been moved to <b><cfoutput>#location#</cfoutput></b><br/> </cfmail> 

This only sends to the first person listed in the query and the cfoutput in the body is still listed as many times as there are recipients.

<cfmail to = "#Schd_Email#;" from="test@test.edu" subject="This is a Test" type="HTML" query="getEmail" failto="test@test.com"> The location has been moved to <b><cfoutput>#location#</cfoutput></b><br/> </cfmail> 

I can output the query to the page and see all emails listed. Not sure why the latter does not work. Any ideas?

Views

314

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
Community Expert ,
May 06, 2016 May 06, 2016

Copy link to clipboard

Copied

Could you show us the entire code, including any cfoutput tags?

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
Community Expert ,
May 07, 2016 May 07, 2016

Copy link to clipboard

Copied

Do something like this:

<cfmail query="getEmail"

        from="test@test.edu

        type="HTML"

        to="#getEmail.Schd_Email#"

        subject="This is a Test"

       failto="test@test.com">

<cfoutput>

#getEmail.someColumnName#

etc. etc.

</cfoutput>

</cfmail>

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 ,
May 09, 2016 May 09, 2016

Copy link to clipboard

Copied

LATEST

There is a chance that the email server may not allow commas as separators for email addresses.  If this is the case, then you'll need to add an argument to valuelist() setting the semi-colon as the delimiter.

valuelist(query.column, ';')

HTH,

^_^

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