A came across the dumb little trick a while back, and wanted to share this.
I like to make the mail sent from an application look like it’s part of the application, but often the step is overlooked during the development process. However by using <cfinclude> and CSS, this can be accomplished:
<cfmail to=”firstname.lastname@example.org” subject=”Yo!” type=”HTML” from=”email@example.com”>
<cfinclude template=”[path to CSS for site]”>
[content goes here.]
Granted, you have to make sure that your CSS not huge, or this becomes inefficient.
One thought on “CSS + CFMail”
The include is nice a neat way of doing this, especially if your generated newsletter email is long and complex. Wrapping a <savecontent/> around the email content can also be an alternative. Then below it you would just output the ‘savecontent’ variable between cfmail tags.