title: Send mail to each array value
body: <p>I have an array $emails. The <code>print_r($emails)</code> output following:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [user_email] =&gt; 
          )
  
      [1] =&gt; Array
          (
              [user_email] =&gt; mail_1@gmail.com
          )
  
      [2] =&gt; Array
          (
              [user_email] =&gt; mail_2@gmail.com
          )
  )
  </code></pre>
  
  <p>Now I want to send emails to all email addresses in this array. I tried:</p>
  
  <pre><code>foreach($emails as $contact) {
  
  $to      =  $contact;
  $subject = 'the subject';
  $message = 'hello';
  mail($to, $subject, $message, $headers);
  
  }
  </code></pre>
  
  <p>What I get is: <code>Warning: mail() expects parameter 1 to be string, array given</code></p>