Advance use of CFMAIL and cfmailParam 

By now you've most likely already realised how useful cfmail is to send out mass-emails informing everyone of your new site and products, and no doubt you've already heard about cfmailParam to send attachments out like new price lists. 

Well now we are going to look at some other way of making your marketing (not spam :o)) email look more professional.

When the user receives your lovely marketing email its just another needle in a giant haystack of a message. So lets help make it stick out a little. 

A basic email script
<cfmail to="mail@thebluefrogcompany.net" from="marketing@thingymejig.com" subject="Brand new special offer" type="html">
  Please check our new thingy-me-jig by visiting the site at http:/www.thingmejig.com
  
  Regards
  The Thingy-me-jig Team
</cfmail>

(if you want run it so you know what it returns)

The first change is a nice touch to make the appearance a little nicer when it is sitting in the inbox. To do this lets look at emails from some larger company's, in this example I?m going to use our blessed Macromedia. If you get any emails from them you'll notice one thing straight away that separates it out from your cfmail email. 

Not seen it yet.... check the "from" column. Yours reads "marketing@thingymejig.com" there?s reads ?Macromedia? and not newsflash@hvm.macromedia.com. 

To remove your email address and put your company's name in there is easy, here?s how...

<cfmail to="mail@thebluefrogcompany.net" from="Thingy-Me-Jig<marketing@thingymejig.com>" subject="Brand new special offer" type="html">
   Please check our new thingy-me-jig by visiting the site at http:/www.thingmejig.com

   Regards
   The Thingy-me-jig Team
</cfmail>

In case you missed it I?ve changed the from="marketing@thingymejig.com" to from="Thingy-Me-Jig<marketing@thingymejig.com>?.

The first part is the name to be displayed; the second part is the reply email address. That?s it, simple and effective.

What if you want the reply address for this emai promo to be different to you main email address supplied in the "from" attribute. This is when our old friend cfmailParam comes into play. As well as being able to attach documents you can also change attributes of the email(the email header) with it. 

Below is our script with the new use of cfmailParam in it.

<cfmail to="mail@thebluefrogcompany.net" from="Thingy-Me-Jig<marketing@thingymejig.com>" subject="Brand new special offer" type="html">
    
   <!--- change the reply address --->
   <cfmailParam name="Reply-To" value="doNotReplyToThisEmail@thingymejig.com">

   Please check our new thingy-me-jig by visiting the site at http:/www.thingmejig.com

   Regards
   The Thingy-me-jig Team
</cfmail>

Again, simple, that?s it!

And finally i know that you wouldn't be sending out a marketing email without it being important, so now to set the priority of the message to catch the users attention.

<cfmail to="mail@thebluefrogcompany.net" from="Thingy-Me-Jig<marketing@thingymejig.com>" subject="Brand new special offer" type="html">

   <!--- change the reply address --->
   <cfmailParam name="Reply-To" value="iLovedYourEmail@thingymejig.com">
 
   <!--- sets the priority --->
   <cfmailParam name="X-Priority" value="1">

    Please check our new thingy-me-jig by visiting the site at http:/www.thingmejig.com

    Regards
    The Thingy-me-jig Team
</cfmail>


Tha?tha?that?s all folks! So now when you send your email it should look something like this in the users inbox



Now go fourth and create professional looking emails

About This Tutorial
Author: Andy Jarrett
Skill Level: Intermediate 
 
 
 
Platforms Tested: CF5
Total Views: 104,179
Submission Date: November 26, 2002
Last Update Date: June 05, 2009
All Tutorials By This Autor: 1
Discuss This Tutorial
  • How do I embed images in emails? This is useful especially for some people who view the emails offline.

  • Flags like X-Priority are also scanned by filters like SpamAssasin, and just having one raises the spam score, since actual spammers love to use this trick too.

  • I love the tutorial dude! Now I can make my newsletters alot better! Also, I didn't know there was such thing as a priority attribute! Thanks!

Advertisement


Website Designed and Developed by Pablo Varando.