PHP send mail from addresses in database
<p>I've read &amp; tried a few posts but can't get this problem solved.  I'm trying to send mail to addresses in a database, but get the following error:  <strong>Warning: mail() expects parameter 3 to be string, array given ...</strong> </p>

<pre><code>include 'datalogin.php';
$sql10 = "SELECT * FROM ex_usrs_admin_dept WHERE linked_dept = '$newdept1'";
$res10 = mysql_query($sql10);
while ($row10 = mysql_fetch_assoc($res10)) {
    $adminid1 = $row10['adminid'];

    $elist = mysql_query("SELECT mail_address FROM ex_usrs WHERE id = '$adminid1'");
    $subject = "This is the subject";
    $headers = "MIME-Version: 1.0" . "\r\n";
    $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

    $message = '&lt;h3&gt;This is the message&lt;/h3&gt;';

    ini_set(SMTP, "10.xxx.xxx.xx");
    ini_set(smtp_port, 25);
    ini_set('display_errors', '1');
    ini_set("sendmail_from", "xx@xx.com");

    if (mysql_num_rows($elist) &gt; 0) {
        while ($elist_result = mysql_fetch_array($elist)) {
            $headers = array('To' =&gt; $elist_result['mail_address']);
            mail($subject, $message, $headers);
        }
    }
} 
</code></pre>
