So the problem has been solved.
on a slightly different manner but maybe for me somewhat more learnfull
🙂 .
But now the code works how i want it to work.
But it don't want to mail something. so i cannot test it.
<html>
<?php
$subject = $_POST['sub'];
$message = $_POST['msg'];
$header = "cc: ";
$mails = $_POST['auth'];
$array = array();
mysql_connect("XXX","XXX","XXX");
mysql_select_db("XXX");
for ($i=0;$i<count($_POST['email']);$i++)
{
$adres = $_POST['email'][$i];
$sql = mysql_query("SELECT email_address FROM users WHERE username='$adres'");
$row = mysql_fetch_array($sql);
If ($i == "0")
{
$header .= $row['email_address']."\r\n Bcc: ";
}
Else
{
$array[] .= $row['email_address'];
}
}
mysql_close();
$header .= implode(",", $array);
$header .= "\r\n FROM: [email]XXX@XXX.nl[/email]";
mail($mails,$subject,$message,$header);
echo "Auteur: ".$mails."<br>";
echo "Onderwerp: ".$subject."<br>";
echo "Bericht: ".$message."<br>";
echo "Header: ".$header;
?>
</html>
And a smal question too.
I made this script for people to mail without eachother seeing thier adresses is this going to work ?
thnx for your help,
Benson