Yesterday I wittered on about IRC, and how I landed there as part of an exercise to help Kyle with a code challenge he was having. Kyle wanted to know if it was possible to write a custom tag which emulated <cfmail> (easy), except including the fact one doesn't need to specify <cfoutput> tags in the body of a mail message with <cfmail>. That got me thinking.
First up, here's a <cfmail> example of what I'm talking about:
<cfset msg = "G'day world">
<cfmail to="dac.cfml@example.com" from="dac.cfml@example.com" subject="#msg#">
#msg#
</cfmail>
And this yields:
type: text/plain; charset=UTF-8
server: 127.0.0.1:25
from: dac.cfml@example.com
to: dac.cfml@example.com
subject: G'day world
X-Mailer: ColdFusion 10 Application Server
body: G'day world
Note how #msg# was resolved in the body of the <cfmail> tag without there being any <cfoutput> tags around it.
If I was to knock out a quick mail.cfm custom tag and try that: