I am trying this on CF 8.0.1, but failing. I am trying to pass a custom value to the custom tag, like this:
<cf_call ckmail="#{to='test@test.com',from='test@test.com',subject='Error reported',mailserver='mail.domain.com',username='1234',password='tested'}#">
In the custom tag call.cfm i have the following:
<cfparam name="attributes.ckmail" default="">
<cfmail attributecollection = "#attributes.ckmail#">
The error I am getting is:
Invalid CFML construct found on line 11 at column 18. ColdFusion was looking at the following text: {
It is working good in CF9, but in CF8.0.1 (or previous version) it is failing with the above message.
Code Update as of July 18th 2012
I tried using dan's Code but now i am facing a different issue, In my Custom Tag i am using like this
<cfset emailSetting = StructNew()>
<!--- loop our query string values and set them in our structure --->
<cfloop list="#attributes.ckmail#" index="key" delimiters=",">
<cfset emailSetting["#listFirst(key,'=')#"] = urlDecode(listLast(key,"="))>
</cfloop>
<cfdump var="#emailSetting#"><cfabort>
<cfmail attributecollection = "#emailSetting#">
The above are my settings in the custom tag, i called it from my code as
<cf_call ckmail="to=i@test.com,from=test@domain.com,subject='Error reported',
server=mail.domain.com,username=test@domain.com,password=tes@,type=html">
The error now i am getting is "smtp" server is not defined,
if i add smtp details in cfadmin it works, may be it ignores values in the field i typed but it shows error when there is no smtp settings defined in the cfadmin too.