Hi
I have a newsletter in a database, with different titles and articles. Normally I display the database content on a page, but now I would like to send the contents of the database to a mail recipient.
I use mail($to, $subject, $message)
so I need to put all of the database entries into the $message.
I tried something like this,
$query="SELECT * FROM $table";
$tabel=mysql_query($query) or die(mysql_error());
while($rij=mysql_fetch_array($tabel)){
$to= $rij["email"];
$subject="Newsletter";
$message= get_tekst($table, $conn);
mail($to, $subject, $message);
}
where get_newsletter() is a function to assemble the different database entries into one page. This obviously does not work.
Can anyone tell me how to do this?
Sugradh