ColdFusion Developer Week 2012

Adobe's second ColdFusion Developer Week kicks off today, June 4, and continues through Friday, June 8, 2012. Whether you're a new or experienced CFML developer, there's probably more than one session you'll find very interesting and useful. From basics to advanced language features, as well as frameworks and a focus on the new ColdFusion 10 release, there's just loads of good stuff, all provided via free online Webinars.

Check out the sessions and schedule, and sign up.

Like last year, I'll be presenting Improve Your Apps Through Unit Testing, tomorrow.

I also hope to revive this sleepy blog with some more interesting tid-bits soon, so stay tuned! It's been a busy year, but I've queued a number of topics for blog posts, so hopefully I can catch up a little in the near future.

cfmailpart order for HTML display in Gmail

It seems that Gmail only renders the HTML part of my multi-part messages from cfmail when the text cfmailpart is before the html cfmailpart.

For example, Gmail will render the text version if I do this:

<cfmail from="#from#" to="#to#" subject="Multi-part, html first">
<cfmailpart type="html"><h1>HTML Message Part</h1></cfmailpart>
<cfmailpart type="text">Text Message Part</cfmailpart>

But if I just swap the order of the cfmailpart entries, then Gmail renders the HTML version:

<cfmail from="#from#" to="#to#" subject="Multi-part, text first">
<cfmailpart type="text">Text Message Part</cfmailpart>
<cfmailpart type="html"><h1>HTML Message Part</h1></cfmailpart>

I had a friend test on Outlook and that client appears to show the HTML part, regardless of the ordering of the text/html parts in the message body. Though I haven't tested any other mail clients yet, I'll keep the text part first and html part second in my multi-part e-mails. I know they'll display as intended in both Gmail and Microsoft Outlook (and I'm guessing most other clients behave like Outlook, in that they'll default to an HTML part if one is there).

cfmail using Gmail SMTP

I wanted to have a cfmail tag use my Gmail SMTP to send mail, which was relatively straightforward, but there is some vague language in the Google help doc that didn't immediately translate to cfmail attribute settings. I did find plenty of search results on the topic, but most threads were a little confusing and noted differing experiences between developers. So I've taken a little time to experiment and thought I'd share the results.

From both my account and my Google Apps for Your Domain mail (gmail for custom domain name) accounts I was able to find the same help doc for standard POP/SMTP configuration.

We can quickly deduce that the username attribute should be your full e-mail address (including or, and the password is of course your Gmail password.

The help doc provides the following information for the outgoing/SMTP server configuration: (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587

So, how does the above information translate to relevant cfmail tag attributes (server, port, username, password, useSSL, useTLS)? It's a bit more specific than the Gmail help doc suggests...


BlogCFC was created by Raymond Camden.