Learning ColdFusion 8: Defining Tags With AttributeCollection

<!---
	Set up the CFMail attributes for this particular
	CFMail tag.
--->
<cfset objAttributes = {
	To = "ben@xxxxx.com",
	From = "ben@yyyyyy.com",
	Subject = "Hey Dude, ColdFusion 8 Is Mad Sexy!",
	Type = "HTML"
	} />
 
<!---
	Now that we have our CFMail attributes set, we need
	to add the base CFMail attributes.
--->
<cfset StructAppend(
	objAttributes,
	REQUEST.BaseCFMailAttributes
	) />
 
 
<!--- Send out the CFMail using the defined attributes. --->
<cfmail
	attributecollection="#objAttributes#">
 
	<p>
		Dude, you gotta try ColdFusion 8! It is so freakin'
		awesome, I couldn't even call asleep last night
		because I couldn't stop thinking about it.
	</p>
 
</cfmail>

For Cut-and-Paste