Using both AttributeCollection and other Attributes with ColdFusion tags in CF 8.0.1

  Jul 18, 2008     7402 Views      ColdFusion       Comments (1)   

The ColdFusion 8 AttributeCollection is one of the coolest features with ColdFusion 8 Release. The ColdFusion 8.0.1 release gave some enhancements to AttributeCollection which is nothing but combining both attributes and attributecollection with a ColdFusion tag. We can use attributecollection like this

<!--- Creating attributecollection name/value pairs for cfmail tag --->

<cfset objMailAttributes = {
Server = "",
Username = "companyxyz",
Password = "zyxcompany",
To = "",
From = "",
Subject = "Using AttributeCollection and Attributes in CF8",
Type = "plain"

} />

<!--- Using attributecollection structure in the cfmail tag --->

<cfmail attributecollection = "#objMailAttributes#" type="html">
Now we can use both AttributeCollection and Attributes with ColdFusion tags in CF 8.0.1

In the above code I have added an attribute type with value "html". So if an individual attribute is already defined in the attributecollection then ColdFusion will only use the individual attribute value. Executing the above code with CF 8.0.0 will throw you an error like below.

The attributeCollection attribute cannot be used in
combination with other attributes in the cfmail tag.

Related Information:

ColdFusion 8 Update 1 Download Link:

ColdFusion 8 Livedocs about AttributeCollection:

Ben Nadel Blog Entry About AttributeCollection in CF8:


1. Chris Bowyer on Mar 30, 2013 at 8:14 AM

Thanks for this article. You answered my question.

About Me

CFML/Web/Cloud/Data/Agile Enthusiast, Husband & Dad, an avid learner & android fan who works as a Tech Consultant in Toronto, Canada.!
Get Your Next CFML Job!
ColdFusion Tuts
ColdFusion Tutorials & Resources


Adobe Agile AppCore Creator BlogCFC Books Bootstrap CFBuilder CFEclipse CFML Chennai CFUG Chrome Extensions ColdFusion Google IIS India Learning MySQL Railo Subversion Tools & Utilities Web Windows 7


2021 2018 2017 2016 2014 2013 2012 2011 2010 2009 2008


Akbarsait © 2008 - 2023 | Hosting provided by Vivio Technologies

Home | Blog | Sitemap | RSS Feed