Skip to main content
Participant
May 5, 2016 9:31 PM UTC
Question

cfmail sending to first email address in query only

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?

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

WolfShade
Legend
May 9, 2016 1:55 PM UTC

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,

^_^

Translate
BKBK
Community Expert
Community Expert
May 7, 2016 4:47 PM UTC

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>

Translate
BKBK
Community Expert
Community Expert
May 6, 2016 9:48 PM UTC

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

Translate