title: for loop in phpmailer
body: <p>I am trying to run the emails to 10 different users, i have made variable $friendsEmails into an array which contains 10 different emails, however looks that it will duplicate 10 for each email thats 10x10. am i doing something wrong? </p>
  
  <pre><code>  for($i =0; $i&lt;11; $i++){
  
      $mail-&gt;SetFrom($email, $name);
  
      $mail-&gt;AddReplyTo($email,$name);
  
      $mail-&gt;Subject    = "We wish you a merry Christmas";
  
      $mail-&gt;AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
  
      $mail-&gt;MsgHTML($body);
  
      $mail-&gt;AddAddress($friendsEmails[$i], $friendsNames[$i]);
  
      if(!$mail-&gt;Send()) {
        echo "Mailer Error: " . $mail-&gt;ErrorInfo;
      } else {
        echo "Message sent!";
      }
  
         }
  </code></pre>