Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfmail read receipt

Status
Not open for further replies.

ScottNeth

Technical User
Mar 11, 2002
44
US
I have a program that sends out a customer order confirmation every time an order is entered, however, several of my orders have wrong e-mail addresses and I need to have a read and/or a received receipt sent back to the person typing the order in.
Knowing that e-mail is simply a modified HTML and that Outlook has read and received receipt capabilities, I assume you can do this with webmail also, but I cannot find how...any body know?
Scott Neth

Scott Neth
Web Designer/Cyberpunk
 
Well... email is not simply modified HTML. Email was developed long before HTML even existed.

With regards to your question specifically, read receipts are not really standardized, unfortunately. They're implemented differently across email clients, and many clients still don't support them at all. And those that do support them typically allow the user to disable them. So counting on read receipts is an iffy proposition.

But, if you insist on pursuing it... ;-)

You need to manually insert headers into your email. You do this using the CFMAILPARAM tag. I believe the header that Outlook needs to drive it's read receipts is "Disposition-Notification-To"... but, like I said, other clients need different headers. So your best hope is to include all the headers that you can find for all clients.

Below is my best guess as to what those headers would be:
Code:
<cfmail to=&quot;#sToAddress#&quot; from=&quot;#sFromAddress#&quot; subject=&quot;A subject&quot; type=&quot;HTML&quot;>

<cfmailparam name=&quot;Disposition-Notification-To&quot; value=&quot;#sFromAddress#&quot;>		

<cfmailparam name=&quot;Return-Receipt-Requested&quot; value=&quot;#sFromAddress#&quot;>		

<cfmailparam name=&quot;Return-Receipt-To&quot; value=&quot;#sFromAddress#&quot;>		

<cfmailparam name=&quot;Read-Receipt-To&quot; value=&quot;#sFromAddress#&quot;>		

<cfmailparam name=&quot;Registered-Mail-Reply-Requested-By&quot; value=&quot;#sFromAddress#&quot;>		

<cfmailparam name=&quot;X-Confirm-Reading-To&quot; value=&quot;#sFromAddress#&quot;>		

Here is the body of your email.
</cfmail>

But, again... it's a crapshoot whether it'll work at all (the above, for instance, only sends a &quot;delivery&quot; receipt to my Outlook 2000 system, not a read receipt... and I'm not sure whether it's an issue with the headers, or my personal inbox settings).



-Carl
 
Forgot to mention... for a much more reliable method of determining whether an email has been read or not... you could use a tracking &quot;bug&quot;... kind of like Adknowledge or some of the other online advertising places use.

In the CFM page that's calling CFMAIL, do something like:
Code:
<cfmail to=&quot;#sToAddress#&quot; from=&quot;#sFromAddress#&quot; subject=&quot;Test, please open&quot; type=&quot;HTML&quot;>
<html>
<body>
<img src=&quot;[URL unfurl="true"]http://yourserver/trackingimage.cfm?email=#URLEncodedFormat(sFromAddress)#&quot;[/URL] width=&quot;1&quot; height=&quot;1&quot; alt=&quot;&quot; border=&quot;0&quot; />

This is the body of the email.

Whatever whatever

</body>
</html>
</cfmail>

Then, on your server, you place a CFM page called
Code:
trackingimage.cfm
(which, if you notice, is called from an IMG tag in the email message) which has the following code:
Code:
<CFCONTENT type=&quot;image/gif&quot;>
<img src=&quot;/images/spacer.gif&quot;>		   
<CFPARAM name=&quot;URL.email&quot; default=&quot;&quot;>

<CFSET decodedEmail = URLDecode(URL.email)>
<CFMAIL to=&quot;#admin_address#&quot; from=&quot;nobody&quot; subject=&quot;email read&quot;>

	The addressee #decodedEmail# read their email at #DateFormat(Now(),&quot;yyyy/mm/dd&quot;)# #TimeFormat(Now(),&quot;HH:mm tt&quot;)#.

</CFMAIL>

This works on all clients that are HTML-capable (which is generally a lot more than those that support read receipts), and works whether they have their servers/inboxes set up to allow read receipts or not.


-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top