im trying to set a cronjob to email me a list of the emails in a db each week. here's my code:
require_once ("config.inc");
$query = "select email from emails";
$result = mysql_query($query);
mail("myemail@this.com","email list","while (
$rows = mysql_fetch_assoc($result))
{
echo(\"$rows[email] \n\");
}","From: [email]sender@that.com[/email]")
or die("error");
echo("should have worked");
im receiving the email, but the body of the email is:
while (
$rows = mysql_fetch_assoc($result))
{
echo(\"$rows[email] \n\");
}
anyone have any ideas on how to do this?
~JOSH