title: Sending multiple email with different body in Php Mailer
body: <p>How am i able to send multiple email with different body?</p>
  
  <p>I have this loop for sending email:</p>
  
  <p><strong>UPDATED:</strong></p>
  
  <pre><code>                // $arr[] here contains email from database
                  // $arrcount = length of $arr[]
  
                  for ($x = 0; $x &lt; $arrcount; $x++)
                  {
                      $email = $arr[$x]; 
  
                  $body = "
                      &lt;div&gt;   
                      &lt;h3&gt;Good Day!&lt;/h3&gt;
  
                              You can now &lt;b&gt; &lt;a href = 'project/welcome/signin.php?email=$email'&gt; sign-in and accept this invitation &lt;/a&gt; &lt;/b&gt;
                          &lt;br&gt;
                       &lt;/div&gt;
                  "; 
                      $mail-&gt;addAddress($email, "You");
                      $query2 = "Insert into ws_invites(user_id,email,date_invited) values ('$myid','$email',now())";
                      $result2 = mysql_query($query2);
                  }
                  $mail-&gt;addReplyTo('myserver@gmail.com', 'Name');
                  $mail-&gt;WordWrap = 50;
                  $mail-&gt;Subject = 'You have been invited';
                  $mail-&gt;Body    = $body;
                  $mail-&gt;isHTML(true);
                  if(!$mail-&gt;send()) { 
                     $fault = "true";
                  }
  </code></pre>
  
  <p>Let's assume I have  3 different emails - <strong>email1@gmail.com</strong>, <strong>email2@gmail.com</strong>, <strong>email3@gmail.com</strong>.</p>
  
  <p>Now what happens here is that the value of the <code>$email</code> of this link: <code>&lt;a href = 'project/welcome/signin.php?email=$email'&gt;</code> is equivalent to <code>email3@gmail.com</code> which is the last recipient of the message and both <code>email1@gmail.com</code> and <code>email2@gmail.com</code> receives that email too which is <code>email3@gmail.com</code>.</p>
  
  <p>So i concluded that the program finishes the loops first before sending email. Now what I want is that each loop sends their corresponding email and not that of the email of the last recipient only. Could this be possible? How?</p>