If you use MS Outlook and you subscribe to any of the email lists from figleaf.com, you may have noticed the informative way that messages are displayed. The "sender" is identified as the list server but the address of the actual sender is also included with the tag line of "on behalf of". So, if boy@george.com sends a message to list-serve@rollingstone.com, the from would be displayed as list-serv@rollingstone.com on behalf of boy@george.com. It took a while for me and my good friend Tracy Rice figure out how to do this in Coldfusion.
Here's a screen shot of the effect we wanted to create:
First we grabbed a raw message file from the mail server that had been sent to our favorite figleaf list the
flashcoders list. What we saw was more than the usual gobbly gook of mail headers (actual email addresses removed).
Message-ID: <003e01c5d8ea$1e17cbb0$1400a8c0@blahblah>
From:
"mrRogers" <mr.rogers@myNeighbor.net>
To:
"Flashcoders mailing list" <*flashcoders list serve email address*>
References: <*message id reference*>
<*messageid reference*>
Subject: Re: [Flashcoders] FileReference class [Get path of a selected file]
Date: Tue,
25 Oct 2005 00:27:28 +0200
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-BeenThere: *flashcoders email address again*
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: Flashcoders mailing list <*flashcoders list serve email address*>
List-Id: Flashcoders mailing list <flashcoders.chattyfig.figleaf.com>
List-Unsubscribe:
<http://chattyfig.figleaf.com/mailman/listinfo/flashcoders>,
<mailto:*flashcoders list serve email address*>
List-Archive:
<http://chattyfig.figleaf.com/pipermail/flashcoders>
List-Post:
<mailto:*flashcoders list serve email address*>
List-Help:
<mailto:*flashcoders list serve email address*>
List-Subscribe:
<http://chattyfig.figleaf.com/mailman/listinfo/flashcoders>,
<mailto:*flashcoders list serve email address*>
Sender: *flashcoders list serve email address*
Errors-To: *flashcoders list serve email address*
Return-Path: <*flashcoders list serve email address*>
X-Envelope-From: *flashcoders list serve email address*
X-Envelope-To: *coldfusion muse's email address*
Let's just stand back a moment in awe of all the really neat stuff that goes on behind the scenes when you send an email. So many things have to go right for it to actually get into my mailbox - yet even folks who don't know me can express concern over the size of my penis and worry about my interest rate. Isn't life in the Internet age grand.
Anyway, Tracy took this list of headers and started inserting them into test mail messages until he got the effect he was looking for. It turns out that the "sender" header is all you need to cause the neat little message. This Coldfusion code creates the "on behalf of" tag line in the from address.
<Cfmail
from="mr.rogers@theneighborhood.com"
to="mr.greenjeans@neighborhood.ocm"
subject="Corn as High as an Elephants Ear">
<cfmailparam name="sender" value="milkman@Farm.com">
Greeny,
How's it hanging?
</CFMAIL>
At this point I only know that it works in Outlook. If you know of other email clients that work with this approach - do tell.