Server Time:
Thursday May 22 2008 02:20 PM  
Your Time:
  
HostMySite.Com is sponsoring this tutorial, please visit their site today!
This tutorial is sponsored by HostMySite.Com - ColdFusion Hosting

Advance uses of CFMAIL and CFMAILPARAM
by: Andy Jarrett
Email this tutorial to a friend Display Printer Friendly Format
[Download in PDF Format] [Download in FlashPaper Format]

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


Date added: Tue. November 26, 2002
Posted by: Andy Jarrett | Views: 19165 | Tested Platforms: CF5 | Difficulty: Intermediate
Categories Listed: Best Practices Mail

HostMySite.Com is sponsoring this tutorial, please visit their site today!
This tutorial is sponsored by HostMySite.Com - ColdFusion Hosting

Please rate this tutorial:
5 Stars 4 Stars 3 Stars 2 Stars 1 Stars
Comments on this tutorial
Read previous comments on this particular tutorial
Great!
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!
Posted by: Matt
Posted on: 07/31/2004 01:37 PM
Caution though
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.
Posted by: Anders
Posted on: 10/15/2004 05:24 PM
Embedding Images in Emails
How do I embed images in emails? This is useful especially for some people who view the emails offline.
Posted by: Adedeji Olowe
Posted on: 12/25/2004 07:24 AM
Post a new comment on this tutorial
post a new comment on this particular tutorial
Your Name:
Your Email:
Comment Title:
Comments:
Key Phrase:
 
Skyscrapper Banner Advertisement
CF 8 Hosting for less then $40 a year!

You are 1 of 363 active sessions! | Privacy | Company
Copyright © 2002 EasyCFM.Com, LLC. (Easy ColdFusion Tutorials) All Rights Reserved (Server: www0002)
All other trademarks and copyrights are the property of their respective holders.
ColdFusion Hosting ColdFusion Hosting
ADD TO:
Blink
Del.icio.us
Digg
Furl
Google
Simpy
Spurl
Y! MyWeb