title: get IP address and email id when receiver open the email
body: <p>I am using php <code>mail()</code> function. but i want that when receiver open email, his/her IP address and email id will save in my db table.</p>
  
  <p>my mail function codes are-</p>
  
  <pre><code>&lt;?php
  require("phpmailer/class.phpmailer.php");
  $mail = new PHPMailer();
  
  // ---------- adjust these lines ---------------------------------------
  $mail-&gt;Username = "mymail@gmail.com"; // your GMail user name
  $mail-&gt;Password = ""; 
  $mail-&gt;AddAddress("$userid"); // recipients email
  $mail-&gt;FromName = "Nikhil Garg"; // readable name
  
  $mail-&gt;Subject = "Newletter Subscription";
  $mail-&gt;Body    = "$usermsg"; 
  //-----------------------------------------------------------------------
  
  $mail-&gt;SMTPSecure = "ssl";  
  $mail-&gt;Host='smtp.gmail.com';
  $mail-&gt;Port = 465;
  $mail-&gt;IsSMTP(); // use SMTP
  $mail-&gt;SMTPKeepAlive = true;
  $mail-&gt;Mailer = "smtp";
  $mail-&gt;CharSet = 'utf-8';  
  $mail-&gt;SMTPDebug  = 0;
  $mail-&gt;SMTPAuth = true; // turn on SMTP authentication
  $mail-&gt;From = $mail-&gt;Username;
  if(!$mail-&gt;Send())
      echo "Mailer Error: " . $mail-&gt;ErrorInfo;
  else
      echo "Message has been sent";
   }
   ?&gt;
  </code></pre>
  
  <p>They are working well. but i don't understand how to get receiver IP address and email Id when they open this email.</p>
  
  <p>Actually i have more then 5000 email list and i want to sort them by city, state, country. with ip address, i can do that. if you know any other way please suggest</p>
  
  <p>my goal is simple and genuine. I just want to know their country so that i will send emails according their country occasions for better selling results. for sending emails to more then 5000 users and ask them for details is not right way.</p>