title: How to add multiple cc email address using phpmailer
body: <p>I'm trying to add multiple email address in phpmailer AddCC().</p>
  
  <p>With below code i am able to add only one email address in cc. But i want to add all the emails fetched from the query.</p>
  
  <pre><code>$sqlcc = "SELECT * FROM notificationslist WHERE status='1'";
  $querycc = $connect-&gt;query($sqlcc);
  
  $num_rowscc = mysqli_num_rows($querycc);
  
  
  if($num_rowscc&gt;0){
  
      while ($row = $querycc-&gt;fetch_assoc()) {
          $ccemail= $row['email'];
          $ccname= $row['employee'];
      }
  } else {
     $ccemail= 'akash1sethi@gmail.com';
     $ccname= 'Akash Sethi';
  }
  </code></pre>
  
  <p><strong><em>PHP MAILER CODE HERE</em></strong></p>
  
  <pre><code>$multiplecc = array(
      $ccemail =&gt; $ccname,
      );
  
  
  foreach ($multiplecc as $ccemail =&gt; $ccname)
  {
      $mail-&gt;AddCC(trim($ccemail), $ccname);
  }
  </code></pre>