Software Technology Tips

We can send emails with ColdFusion using cfmail tag, but we do not have a direct way to track whether an email has been read/opened by the recipient or not. We can do this using some indirect way mentioned below.

While developing an email functionality with cfmail, we can include one 1X1 px image in the mail body using <img src="". Instead of providing the path of the image for src directly, we can provide the path of one CFM template present on the server. The URL should contain one random number as URL parameter created using CreateUUID() function to uniquely identify each server request when the email is opened. In the CFM template we can render the 1X1 px image using cfcontent and also we can run an update query to set the email status flag to "Read".

Sample Code:

<cfmail from="" to="" subject="test subject" server="mailServerIP" type="text/html">
<img src="">
Email Text




When the above piece of code loads the body of the email, it makes one unique server call to one CFM, then we can render the image and also can make other server side operations to set the status of the email as "Read".

Note: Similar techniques are used in phising attacks too but in this scenario this technique adds a functionality to check if the sent mail has been opened, so to avoid anti-phising mechanism/filters of mail clients, users need to make sure that -

  • Email clients support HTML format
  • Image download is enabled or users explicitly download image by clicking on "Download Image"
  • This technique doesn't work in offline mode

Related Tags:


Author: Sankalan Panda

Related Pages

  • Coldfusion Development Skills
  • Coldfusion Application Projects


Let us Connect!

Awards and Achievements

Red Herringcolor DeloitteFast50 DB ZInnov1   Nascome  DB Stpi

This site uses cookies. We respect your privacy.copyright (c) Mindfire Solutions 2007-2015. Login