PHP Code:
if ($DB_site->num_rows($users)) {
$page = $startat/$perpage+1;
$totalpages = ceil($counter[total]/$perpage);
echo "<p><b>Emailing users. Page $page/$totalpages (".number_format($counter[total])." users total).</b></p>";
if (strpos($message,"\$activateid")) {
$hasactivateid=1;
} else {
$hasactivateid=0;
}
while ($user==$DB_site->fetch_array($users)) {
echo "$user[userid] - $user[username] .... \n";
flush();
$userid=$user[userid];
$sendmessage=$message;
$sendmessage=str_replace("\$email",$user[email],$sendmessage);
Try that