title: PHP: Check who had read sent email?
body: <p>I am sending email to some users and wants to know who had read it, means if some one had read that email then a log file will maintain which contain the email address of that user with date/time/IP.
  For this I send a javascript function with the email (html template) which just alert the email address of the user when ever a user opens that email like:</p>
  
  <pre><code>for($n=0; $n&lt;sizeof($checkBox); $n++){
          $mail = new PHPMailer();
          $mail-&gt;IsHTML(true);
          $mail-&gt;Subject = $subject;
          $function = "&lt;script language='javascript'&gt;function stats(emailId){alert(emailId);}&lt;/script&gt;";
          $bodyOpen = "&lt;body onload='stats(".$checkBox[$n].");'&gt;"; 
          $msg_body .= $body .= "&lt;table&gt;&lt;tr&gt;&lt;td&gt;Hello Everyone&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;";
          $mail-&gt;Body = $function.$bodyOpen.$msg_body;
          $mail-&gt;WordWrap = 50;
          $mail-&gt;FromName = 'Muhammad Sajid';
          $mail-&gt;IsMAIL();        
          $mail-&gt;From = 'webspot49@gmail.com';
          $mail-&gt;AddAddress($checkBox[$n]);
          $sent = $mail-&gt;Send();
      }
  </code></pre>
  
  <p>the html template works fine and shows an alert popup on page load but it does not works if I use to send this html template.</p>
  
  <p>And I only want to solve this issue using PHP5.x.x / javascript, no other software or third party tool.
  Any help..?</p>