Hello there I have my code below, I basically have a little script that is working, but not how i want it to. When i run the script it is sending it to all the email addresses in the database however it is printing all the names and email addresses to everyone? Im guessing I need to throw a loop in there somewhere or split the array, i’m not entirely sure. Can anyone give me a push in the right direction?
[php]
$result = mysql_query(“SELECT * FROM mail_list”);
while($row = mysql_fetch_array($result)){
$names[] = $row[‘name’];
$addresses[] = $row[‘email’];
}
$to = implode(", “, $addresses);
$recipitent = implode(”, “, $names);
$subject = “We Are Live”;
$from = "[email protected]”;
$headers = “From:” . $from;
$message = "Dear " . $recipitent . “Welcome to our site!”;
mail($to, $subject, $message, $headers);
[/php]
So I wanted to send out the emails individually to each person?