For CFMail - I am building a To: list and BCC: list using cfset tolist and cfset bcclist
These output just fine. But when I add them into the cfmail - the tolist and bcclist error.
I am not sure why, as they are just comma delimited lists.
Get: The value of the attribute to, which is currently emailthis@gmail.com,emailthat@gmail.com,emailagain@gmail.com is invalid.
When I hard code in the above list - it works just fine.
The alist and clists below create just fine, and look just fine to me. I can't seem to find a solution to what I'm doing wrong.
<cfoutput>
<cfif isdefined("form.checkbox1")><cfset clist = "#checkbox1#"></cfif>
<br><br>Check List #clist#
</cfoutput>
To:
<cfset tolist = "#clist#,<cfif alist is not "">#alist#,</cfif><cfif len(other)>#other#</cfif>">
<cfoutput>#tolist#</cfoutput>
BCC List - basically the same
<cfoutput>
<cfmail type="html" from="bob@bob.com" to="#tolist#" bcc="#bcclist#" mimeattach="#pdfpath#file.pdf" subject="File.pdf">
Blahhh
</cfmail>
</cfoutput>