title: phpMailer: Send emails to multiple recipients
body: <p>I am trying to send emails to multiple recipients. </p>
  
  <p>So far, I was able to retrieve the email addresses in an array. But the mail function somehow does not accept the email addresses. Instead, it gives an error that it needs at least one email address to send an email, and it displays the emails inside the array.</p>
  
  <p>Have a look at my code below.</p>
  
  <pre><code>$email = "select email from student"; 
  
  
  if ($p_address=mysql_query($email))
  {
  $address = array();
  
  while($row = mysql_fetch_array($p_address))
  {     
  $address[] = $row;
  }  
  
  for ($i = 0; $i &lt; count($address); $i++) {
  $all_address[] = implode(';', $address[$i]);
  }
  
  foreach ($all_address as $aa) {
  
  $mail-&gt;AddAddress($aa);
  }
  </code></pre>
  
  <p>Hope that you could help. Thanks.</p>