title: PHPMailer setting for individual emails is sending empty To: fields
body: <p>Using PHPMailer to send individual emails to recipients I'm getting nothing in the <strong>To:</strong> field when I add <code>$mail-&gt;SingleTo = TRUE;</code> to my code.</p>
  
  <p>When I remove <code>$mail-&gt;SingleTo   = TRUE;</code> I receive emails with an email address in the <strong>To:</strong> field that is correct.</p>
  
  <p>This is what I get:</p>
  
  <pre><code>reply-to     xxxxxx &lt;xxxx@xxxx.com&gt;, No Reply &lt;no-reply@no-reply.com&gt;
  to    
  date         Mon, Mar 21, 2011 at 5:07 PM  
  subject      Testing    
  mailed-by    gmail.com 
  signed-by    gmail.com
  </code></pre>
  
  <p>(where xxxxxxx represents my email address.)</p>
  
  <p>Here's my code:</p>
  
  <pre><code>if(isset($_POST['submit']))
  {
      require_once('PHPMailer_v5.1/class.phpmailer.php');
  
  
  $mail         = new PHPMailer();
  
  $subject = $_POST['subject'];
  $body    = $_POST['emailbody'];
  $to         = $_POST['to'];
  
  
  
  $mail-&gt;IsSMTP(); // telling the class to use SMTP
  //$mail-&gt;Host       = "localhost"; // SMTP server
  $mail-&gt;SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
                                             // 1 = errors and messages
                                             // 2 = messages only
  $mail-&gt;SMTPAuth   = true;                  // enable SMTP authentication
  $mail-&gt;SMTPSecure = "SSL";                 // sets the prefix to the servier
  $mail-&gt;Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
  $mail-&gt;Port       = 587;                   // set the SMTP port for the GMAIL server
  $mail-&gt;Username   = "xxxxxxxxxx@gmail.com";  // GMAIL username
  $mail-&gt;Password   = "*********";            // GMAIL password
  
  $mail-&gt;SetFrom('xxx@xxx.com', 'XXXXXX');
  
  $mail-&gt;AddReplyTo("no-reply@xxxxx.com","No Reply");
  
  $mail-&gt;Subject    = $subject;
  
  // After adding this line I'm getting an empty To: field 
  $mail-&gt;SingleTo   = TRUE;
  
  $mail-&gt;AddAddress("address1@xxxxxx.com", 'xyz abc');
  $mail-&gt;AddAddress("address2@xxxxxx.com", 'abc xyz');
  //$mail-&gt;AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
  
  $mail-&gt;MsgHTML($body);
  
  
  if(!$mail-&gt;Send()) {
    $message= "Mailer Error: " . $mail-&gt;ErrorInfo;
  }
  else
  {
    $message= "Message sent!";
  }       
  }
  </code></pre>