Hello everyone,
I have built a member program with phprunner. I want to add a mail function, to send the members an email. I do that with this code:
global $dal;
//select emails from Users table
$tblUsers = $dal->Table("members");
$rs = $tblUsers->QueryAll();
while ($data = db_fetch_array($rs))
{
$email=$data["Email"];
$from="my@test.com";
$msg="This is a test";
$subject="Monthly newsletter";
$ret=runner_mail(array('to' => $email, 'subject' => $subject,
'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"]."
";
}
But sometimes I only want to send an email to a part of the member table, eg by making a query. How should the code be modified? thanks.