How to CFMAIL Properly and Keep the SPAM in the Can

One of the most commonly used ColdFusion tags may also be one of the most misused. I say this because of the ColdFusion code that I've seen in production. It appears that a large number people think that all you need to do is open the CFMail tag and type in a to address the from address a subject and then close the tag. And then stuff your email message between the opening and closing tags. People do it this way as this is how they are shown, see the examples below.

Adobe LiveDocs CF7,8,9:

<cfmail to = "#form.mailto#"
from = "#form.mailFrom#"
subject = "#form.subject#">

This message was sent by an automatic mailer built with cfmail:
= = = = = = = = = = = = = = = = = = = = = = = = = = =
#form.body#
</cfmail>

Common blog example found via a typical Google search:

<cfmail
to = "name@yourdomain.com"
from = "name@yourdomain.com"
subject = "Example of CFMail Tag using Coldfusion 5.0"
server = "mail.yourdomain.com">

Email Message
</cfmail>

While both examples are technically correct and will send an email from your ColdFusion server they all lack what most people are trying to achieve in sending HTML formatted/pretty email messages and messages with attachments. There are precise ways in which the RFC (RFC-822) standard for sending e-mails dictates that these are to be done and ColdFusion allows you to follow the standard exactly. You just need to know how. I am not going to bore you with the RFC standard details, however if you are suffering from insomnia feel free to read them. What I will show you is how to send an HTML formatted email with the proper email message parts and optional file attachments so that it will safely pass most if not all SPAM filter tests and will render properly in mail clients.

The above code would generate email that looked like this when you examine the raw email source.

Return-Path: <some_address@somedomain.com>
Delivered-To: myaddress@mydomain.com
X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on
   mail.mymailserver.com
X-Spam-Level: **
X-Spam-Status: No, score=2.8 required=5.0 tests=HTML_MESSAGE,
   HTML_MIME_NO_HTML_TAG,MIME_HTML_ONLY,RDNS_NONE autolearn=no version=3.2.4
Message-ID: <1331187905.1191260207349870.JavaMail.root@mail.mymailserver.com>
Date: Mon, 7 Dec 2009 11:35:39 -0600 (CST)
From: John Doe <some_address@somedomain.com>
Reply-To: some_address@somedomain.com
To: myaddress@mydomain.com
Subject: Hows life
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

John Doe,<br><br>

Just wondering how things are going.

Looks good, right? However, there are some issues. There are HTML tags in the body of the message, but there is no text portion of the message. If you notice the header information you will see an item for X-Spam-Status and this indicates a score of 2.8. This score was not high enough yet to dictate that this was SPAM according to this SPAM servers rules (on other email servers it might get flagged as SPAM), but you will notice that the items it flagged were almost all HTML related items such as HTML only. In order to reduce the SPAM score you need to properly format your email messages.

[More]



Thanks Alagad

The wonderful folks at Alagad had a promotional give away of three Wenger SwissGear backpacks to help promote TaskForce at CF.Objective(). I won one of them! WooWoo! Thanks Alagad!



ColdFusion Builder Bug 82358 Fixed

I just received an email from the ColdFusion Builder developers informing me that a bug I entered (bug# 82358) is fixed. As the snippet of the email below shows the bug fix is in Updater 1. I hope the Updater comes out before the end of my Trial Period. Because I was a beta tester and had the Release Candidate installed I only have 21 days left on my trial version.

I hope the fix was not just increasing the memory allocation in the cfbuilder.ini file. I tried that in the past on Adobe developer recommendations and proved it didn't help. I do also disagree with the "Easy workaround" since my workaround was to use CFEclipse.

Anyways, this is good news because this was one of the main issues I wasn't going to buy ColdFusion Builder. I really want to test this now!

[More]



Migrating to ColdFusion Builder from CFEclipse

Many people have been using CFEclipse for several years now and are now migrating to ColdFusion Builder. Since both are Eclipse based products this is pretty simple, but there are a few things that will not migrate without manual intervention.

First start with installing ColdFusion Builder. (See this.)

Next lets import your CFEclipse Projects. You can do this and it is easy since it is really an Eclipse feature not specific to any add-ons. Right click in the Navigator view and choose "Import". The windows that opens give you many options for what to import. You are going to click and expand the "General" folder and then choose "Existing Projects into a Workspace" and click the Next Button.

If you are using an SVN and you plan to use an Eclipse SVN plug-in in ColdFusion Builder install that plug in before importing your projects, the import process will automatically reconnect the imported projects to your SVN(s). You will also want to configure the SVN plug-in to access all repositories before you run the imports.

[More]



Adobe ColdFusion Builder Released

Today Adobe released ColdFusion Builder 1.0. It's been a long time coming and a lot of people have been patiently waiting for this day. Unfortunately Adobe should have waited longer and fixed more of the outstanding bugs and painful performance issues. Then to add to the insult, the price was set at $299 but that does include Flash Builder 4 Standard. However, I still find it way too high of a price for a product that does NOT measure up. As others will note Flash Builder 4 Standard cost $249 so essentially you are paying $50 for ColdFusion Builder. This is great if you wanted to buy Flash Builder. Many of us never touch Flash so this is not much of a bargain.

Then there are performance issues. ColdFusion Builder is painfully slow when it comes to rebuilding project workspaces. It works fine for little projects, but serious enterprise level web applications with thousands of files and folders, such as what I work on, ColdFusion Builder is just slow or worse yet if just fails and throws errors. I've recorded this as a bug and nothing has been done about the problem as far as I can tell.

[More]



More Entries