所以,我在一个免费的网络主机 3owl.com 上运行。我知道免费主机与付费主机相比很糟糕,但它是暂时的。无论如何,我有 90 个用户需要向他们发送电子邮件。
问题:
I cannot send them at a speed of more than 1 every 4 seconds.
I must not run the while loop for more than 40 seconds at a time.
所以,我需要帮助弄清楚如何分段发送电子邮件。
Send email 1
4 second break
Send email 2
4 second break
Send email 3
4 second break
Send email 4
4 second break
Send email 5
4 second break
Send email 6
4 second break
Send email 7
4 second break
Send email 8
4 second break
Send email 9
4 second break
Send email 10
---------------
STOP SCRIPT in a way that doesnt load the website? for 10 seconds
---------------
continue with the next 10
这甚至可能吗?也许是某种列出用户的复选框系统,您可以检查您希望将其通过电子邮件发送给谁......
这是我当前的代码
mail_users($_POST['subject'], $_POST['content']);
其功能如下所示:
function mail_users($subject, $body) {
$query = mysql_query("SELECT `email`, `first_name` FROM `users` WHERE `allow_email` = 1");
while (($row = mysql_fetch_assoc($query)) !== false) {
email($row['email'], $subject, "Hello ". $row['first_name'] . ",\n\n" . $body);
sleep(4);
}
}
我非常需要帮助。复选框可能需要一些javascript