Jump to content

email acknowledgement - follow-up

Go to solution Solved by kicken,

Recommended Posts

I'm trying to track an email message by adding an image to an email.  (a very rough attempt to just get a result)

<img alt="" src="http://yourwebsite.com/record.php width="1" height="1" border="0" />

My understanding being that when the email is opened, the script will be called, and then send the image to the email.

However, the code seems to be ineffective in passing the image.

My desktop email shows no image, and my cellphone image shows an error/no image symbol

I've tried code as simple as

header("Content-Type: image/gif");

and as complex as 

//Full URI to the image
$graphic_http = 'http://yourwebsite.com/blank.gif';

//Get the filesize of the image for headers
$filesize = filesize( 'blank.gif' );

//Now actually output the image requested (intentionally disregarding if the database was affected)
header( 'Pragma: public' );
header( 'Expires: 0' );
header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
header( 'Cache-Control: private',false );
header( 'Content-Disposition: attachment; filename="blank.gif"' );
header( 'Content-Transfer-Encoding: binary' );
header( 'Content-Length: '.$filesize );
readfile( $graphic_http );

with no success.

What am I missing?

PS: I've tried it at the top and the bottom (where I would want it) of my email message, but no joy.

Link to comment
Share on other sites

I did not, but I have no issues with viewing the <img  src> when written directly into the HTML.

Does the remote content setting handle the capability for exactly what I'm trying to accomplish?  [of course it does, right... LOL]

Link to comment
Share on other sites

20 minutes ago, phppup said:

So this is on the CLIENT side?

Yes, for example, in Thunderbird which is what I use, there is this setting:


Unless that is checked, anything that requires accessing a remote server to display will not be loaded. The learn more link goes here if you're interested.

Since I leave that setting off, most of the marketing emails I get end up like this:


A little bit of text, lots of image placeholders / alt text.  Some companies manage this better than others.  Attaching images or using data: url's will allow them to show, but of course that doesn't help you with your desire to track things. 



Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.