eskander (eskander) wrote in mysql,

updating a database from a received email

hey everyone,
i've got a problem and having a hard time wrapping my head around a solution.

i'm writing an app in php that will send an email notification to about 100 people, my boss wants to know how many people actually open the emails, so what i've done is created a field in the db for views.

what i want to do is when someone opens the email it increments the views by 1. simple enough right?
i thought maybe i'd hide an iframe in the email that goes to a php script on the server that would update the views in the db. hit a road block since 99% of email clients now block or disable iframes in emails.

so are there any other ways to go about doing this?
  • Post a new comment


    default userpic
Can you have the content of the email be pulled via http? If so you should be able to do this a number of ways.
not sure i catch what you mean
There's a reason why most clients will block images from loading by default in an email. It's because the image is how most trackers determine if an email was opened.

Beyond that there is no other way short of adding the 'request read notification' flag to the email.
thats what i was thinking, but was hoping otherwise.

so aside from going through the logs and asking them to click 'open', there's no other way of doing it

doesn't make sense though. the asp version that they want me to replace does it by view of the image
You can do the same thing. Just make a PHP script which serves up an image but logs the view.
the idea i had was to do exactly that through an iframe, doesn't work though.
You're misunderstanding.

Do something like <img src="">

where tracking.php looks like an image to the browser but internally logs the message being read.
that works?
going to have to try it
you are my saviour!

thanks so much

not sure if i'm doing it right though
i've got the image i want to show the

and then i have

i've set the height and width of the new 'image' to 0 so that i don't get a missing file icon, though i still get one in outlook for some reason
it updates the db, thanks to your help, but is there a way to get rid of the file missing icon in outlook?
sorry, that should show

<img src='......./img.jpg' />

and then i have
<img src='....../update.php' width='0' height='0' />
Actually serve up an image. I don't have any experience in this, but it should be as simple as something like...


set headers

do database crap

write image to http stream