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?
Copy link to clipboard
Copied
Could you show us the entire code, including any cfoutput tags?
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>
Copy link to clipboard
Copied
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,
^_^