Doing IF Tests Within CFMAIL

You've probably noticed that CF leaves white space in HTML pages where CF tags existed before the page was processed. You may have wondered, therefore, if you need to have similar concerns if you're using tags within the body of a CFMAIL.

The good news is that it's not a problem. Consider the following:

<cfmail TO="carehart@systemanage.com"
FROM="carehart@systemanage.com"
SUBJECT="test of if's in email">
this is a test, with cfif 
<cfif 1 is 2>xx</CFIF>within it
</CFMAIL>

When the resulting message arrives, the space taken by the CFIF does not remain within the email.

Charlie Arehart
Founder and CTO
Systemanage

© 2008 SYS-CON Media