所以,我在一個免費的虛擬主機3owl.com上運行。我知道免費主機與付費相比是吸引人的,但它是暫時的。無論如何,我有90個用戶需要發送電子郵件給他們。在php中分段發送大量電子郵件?阻止垃圾郵件
問題:
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用於複選框
是否有一個原因,你需要使用網頁中的代碼來做到這一點?您是否考慮將您的電子郵件列表導出到Outlook或ConstantContact? – aviemet
你有shell嗎?用qmail替換sendmail,你可以排隊你的發送。它在我需要管理一定時間間隔內發送的消息數量的相同情況下爲我工作。而不是做廣告,但Digital Ocean提供每月5美元的罰款lampp託管。 – chiliNUT