#!/usr/bin/php -q = '$lastid' AND email not like 'a20%cacert.org' ORDER BY `id`"; /* $query = " SELECT `id`, `fname`, `lname`, `email` FROM `users` WHERE `deleted` = '0000-00-00 00:00:00' AND `modified` != '0000-00-00 00:00:00' AND `verified` = '1' AND (`id` = '87908' or `id` = '12438') ORDER BY `id`"; */ $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { $mailtxt = "Dear ${row["fname"]} ${row["lname"]},\n".$lines_EN."\n\n"; sendmail($row['email'], "[CAcert.org] CAcert Inc. moved to Europe (legal information)", $mailtxt, "support@cacert.org", "", "", "CAcert", "returns@cacert.org", ""); $fp = fopen("send_policy_cca20240925_lastid.txt", "w"); fputs($fp, $row["id"]."\n"); fclose($fp); $count++; echo "Sent ${count}th mail. User ID: ${row["id"]}\n"; // if(0 == $count % 16) { // sleep (1); // } if ($count >= 3000) { // avoid memory exhaustion -- this script has a memory leak echo "Continue\n"; exit(0); } } echo "Stop\n";