title: How can I send an email to multiple recipients using the Mandrill API?
body: <p>I have found similar questions, but still not clear to me.
  How can I send an email to multiple recipients using the Mandrill API?</p>
  
  <p>The quantity of recipients may vary according to the information stored on the db:</p>
  
  <pre><code>$query = "SELECT emails FROM emails_table";
  $data = mysql_query($query);
  $n = 0;
  while ($row = mysql_fetch_assoc($data))
  {
  $email[$n] = $row['emails'];
  $n++;
  }
  </code></pre>
  
  <p>So, emails will be stored in variables like this. E.g.</p>
  
  <pre><code>$email[0] = email_0@example.com;
  $email[1] = email_1@example.com;
  $email[2] = email_2@example.com;
  </code></pre>
  
  <p>And this is the Mandrill API:</p>
  
  <pre><code>require("/mandrill_mail/src/Mandrill.php");
  
  try {
      $mandrill = new Mandrill('kWre_48F1lnJs3_39YM434z');//API KEY
      $message = array(
          'html' =&gt; 'message',
          'subject' =&gt; 'subject',
          'from_email' =&gt; 'my_mail@my_domain.com',
          'from_name' =&gt; 'My_Domain',
          'to' =&gt; array(
              array(
                  'email' =&gt; $email[0], //How can I add the other emails considering that the number of recipients will vary depending on the data in the db?
                  'name' =&gt; 'Recipient Name',
                  'type' =&gt; 'to'*/
              )
          ),
          'headers' =&gt; array('Reply-To' =&gt; 'my_mail@my_domain.com'),
          'important' =&gt; false,
          'track_opens' =&gt; null,
          'track_clicks' =&gt; null,
          'auto_text' =&gt; null,
          'auto_html' =&gt; null,
          'inline_css' =&gt; null,
          'url_strip_qs' =&gt; null,
          'preserve_recipients' =&gt; false,
          'view_content_link' =&gt; null,
          'bcc_address' =&gt; $mail_bc,
          'tracking_domain' =&gt; null,
          'signing_domain' =&gt; null,
          'return_path_domain' =&gt; null,
          'merge' =&gt; true,
          'merge_language' =&gt; 'mailchimp',
  
      );
      $async = false;
      $ip_pool = 'Main Pool';
  
      $result = $mandrill-&gt;messages-&gt;send($message, $async, $ip_pool);
  } 
  </code></pre>