title: Multiple Emails with PHPMailer
body: <p>I am trying to send emails to mutiple people with different bodies using one code, using PHPMailer via SMTP. My code is as follows : </p>
  
  <pre><code>if ($_SERVER["REQUEST_METHOD"] == "POST") 
  {   
  require_once("class.phpmailer.php");
  $mail = new PHPMailer();
  $mail-&gt;IsSMTP();
  $mail-&gt;SMTPAuth   = true;                
  $mail-&gt;Host       = "xxxxxxxx"; 
  $mail-&gt;SetFrom('xx@xxx.com');
  $mail-&gt;Subject    = "System Change";
  
  $add = array("a", "b", "c");
  foreach ( $add as $address ) {
  $current = clone $mail;
  if ( $address == 'a' ) 
  {
      $current-&gt;AddAddress('xx@xx.com');
      $current-&gt;MsgHTML("Message1");
      $current-&gt;send();
  } 
  if ( $address == 'b' ) 
  {
      $current-&gt;AddAddress('xx@xx.com');
      $current-&gt;MsgHTML("Message2");
      $current-&gt;send(); 
  }
  if ( $address == 'c' ) 
  {
      $current-&gt;AddAddress('xx@xx.com');
      $current-&gt;MsgHTML("Message3");
      $current-&gt;send(); 
  }
  }
  exit;
  if($mail-&gt;Send())
  { echo "SUCCESSFUL"; }
  else echo "ERROR IN SENDING MAILS";
  exit;
  }
  ?&gt;
  </code></pre>
  
  <p>The issue is it is sending mails but only sending the first 2, and then displaying a timeout error. Is there any setting that I need to change or is it a problem with my code? Have edited it in many ways but it ends up sending only 2 mails instead of 3. Appreciate any help :) Thanks!</p>