freakedout Posted January 22, 2008 Share Posted January 22, 2008 Hi, I have a php script that allows admin to send mail to users. Now I need to add some code by which i can track how many times mail was opened or viewed etc Is there any way to add some code of php etc that could track this I had an idea of adding blank gif image to the mail but many mail programs blocks images so that will become useless can anyone give some ideas how to do this. Thanks in Advance Quote Link to comment https://forums.phpfreaks.com/topic/87191-email-tracking/ Share on other sites More sharing options...
adam291086 Posted January 22, 2008 Share Posted January 22, 2008 This isn't possible. You would need away to get the user to run the script everytime the mail is opened. If they aren't connected to the internet, i.e using outlook, then how is that information going to be sent to you? Quote Link to comment https://forums.phpfreaks.com/topic/87191-email-tracking/#findComment-445964 Share on other sites More sharing options...
freakedout Posted January 22, 2008 Author Share Posted January 22, 2008 Hi adam, i have gone thru' different forums and i got to know that this can be done using web beacons or by attaching 1x1 image in the html formatted mail.........But i am looking for an example code that would explain things easily. I tried implementing it myself. please lemme know where i am wrong.... trackEmail.php <?php // multiple recipients $to = 'ex@ex.com'. ', '; // note the comma $to .= 'ex@ex.com'; // subject $subject = 'Test mail for email tracking'; // message $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</p> <table> <tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</td> </tr> </table> <img src="trackImage.php"> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?> trackImage.php <?php echo "This is the image displayed"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/87191-email-tracking/#findComment-445973 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.