ColdFusion CFMailParam's New "Content" Attribute Is Awesome

<!---
	Grab an image from flickr.com and create a ColdFusion image
	object via the URL.
--->
<cfset objImage = ImageNew(
	"http://farm3.static.flickr.com/2304/2335117561_513d9f8a76_b.jpg"
	) />
 
<!--- Resize the image so that it's not too big. --->
<cfset ImageScaleToFit( objImage, 300, 300 ) />
 
<!--- Add a border. --->
<cfset ImageAddBorder( objImage, 2, "##333333" ) />
 
 
<!--- Create a signature variable. --->
<cfsavecontent variable="strSignature">
	Ben Nadel
	Kinky Solutions
	www.kinkysolutions.com / www.bennadel.com
</cfsavecontent>
 
 
 
<!--- Send out email. --->
<cfmail
	to="xxx@yyyyyyy.com"
	from="yyy@zzzzz.com"
	subject="Is that your wife???"
	type="html">
 
	Dude, I was doing some research for a business project
	and I came across the attached file. Call me crazy,
	but is that your wife making out with another chick??<br />
	<br />
 
	You better lock that down!<br />
	<br />
 
	<img src="cid:kissing" /><br />
	<br />
 
	Cheers,<br />
	Ben
 
	<!---
		Attach file for inline usage. Use the contents of the
		image object for the value of the CFMailParam. Unlike
		the Content attribute in CFContent, we do not need to
		use a binary variable here.
	--->
	<cfmailparam
		file="wife_kissing_girl.jpg"
		contentid="kissing"
		content="#objImage#"
		disposition="inline"
		/>
 
	<!--- Attach signature text. --->
	<cfmailparam
		file="signature.txt"
		content="#Trim( strSignature )#"
		/>
 
</cfmail>

For Cut-and-Paste