Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    188
    Thanks
    17
    Thanked 0 Times in 0 Posts

    Detect if an Email has Been Opened

    Hi

    I send an automated newsletter to people that request it and im curious to wonder how many people are opening the emails i send. Is there a way to detect this and store if they did open it in a mysql database using php?


    Thanks

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    There are two ways to do this. One is to use an image embedded inside the email contents with a unique id.

    <img src="http://yourserveraddress.com/images/email.gif?id=111" alt="cofirm"/>

    the source of the image will be stored at your server, and therefore...once someone opens the email...the image would load...and you would know that person has opened the email and obviously read it.

    second method is to add the following to the email header, but I don't think that it would work with email accounts such as hotmail, yahoo etc.

    $header .= "Disposition-Notification-To: <" . $confrim . ">\r\n";

    Cheers,
    Ess

  • Users who have thanked ess for this post:

    thekevin07 (09-04-2007)

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Quote Originally Posted by ess View Post
    There are two ways to do this. One is to use an image embedded inside the email contents with a unique id.

    <img src="http://yourserveraddress.com/images/email.gif?id=111" alt="cofirm"/>

    the source of the image will be stored at your server, and therefore...once someone opens the email...the image would load...and you would know that person has opened the email and obviously read it.

    second method is to add the following to the email header, but I don't think that it would work with email accounts such as hotmail, yahoo etc.

    $header .= "Disposition-Notification-To: <" . $confrim . ">\r\n";

    Cheers,
    Ess
    ....and store if they did open it in a mysql database using php?
    is it possible by the above methods?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #4
    Regular Coder
    Join Date
    Dec 2006
    Posts
    188
    Thanks
    17
    Thanked 0 Times in 0 Posts
    I'll try both and post my results


    Thanks

  • #5
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Neither method is 100%, though they are creative. I personally have images turned off in email and I always answer "no" to an email confirmation request. You may get enough feedback to be helpful to you but it won't give you an accurate statistic.

  • #6
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,146
    Thanks
    2
    Thanked 333 Times in 325 Posts
    Also, be advised that the <img ... /> tag only has meaning in a HTML email and is only a string of characters in a plain text email, such as when the user has configured his email client for plain text only.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #7
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    A properly configured email program does not allow the sender of the email to know that the recipient has even received the email let alone opened it. Where an email program is incorrectly configured so that it does report back when emails are opened any spam that is accidentally opened then generates thousands of additional spam emails since the spammer now has a confirmed email address that has an incorrectly configured email program where they know that their spam will be seen.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •