Hi,
I am stuck trying to do the following:
email all users from my recordset that match the following criteria:
membership will expire within 5 days
I have got my SQL statment to work (although there is probably a better way to word it, it works)
$query_rsusers1 = "SELECT * FROM users WHERE (TO_DAYS(users.endaddate) <= TO_DAYS(NOW())+5) AND (TO_DAYS(users.endaddate) > TO_DAYS(NOW()))";
This gives me the list of all the users in my "users" table whose membership will exprire between tomorrow and 5 days time.
I can therfore retrieve their email :
$row_rsusers1['email'];
So I'm trying to send them an expiring subscription message as follow:
$email_text = $_REQUEST['email_text'] ;
$address = $row_rsusers1['email'];
mail( "$address", "membership expiring notice",
"
$email_text", "From: info@mysite.com" );
header( "Location: http://www.mysite.com/admin/email_sent.php" );
Of course, this does not work as I only send to one recipient and I have no idea how to syntax it so it sends to all recipeints from the recordeset.
Many thanks for your help,
Vinny