PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The below code sends emails, to 3 recipents pulled from my sql database. Each email send successfully. What im trying to do is, display these 3 email addresses within my email message.
Thats the bit that isnt working. Any ideas?
You are pulling the email addresses of your db into the array $email and convert it into a string using your $to variable.
Just try to use $to again in your message. This should display the email addresses.
foreach($email as $mail)
{
$message .= $mail."\r\n";
}
Since you are passing your array to $email should the foreach loop pull the single email addresses back out add your linefeed and pass it on to $message.