以下のコードを使用して、データベースから多くの人に電子メールを送信しますが、通常はタイムアウトになり、すべての人に送信されるわけではありません。PHPで10分あたりわずか1000通のメールを送信するようにPHPで設定するにはどうすればよいですか?
require_once "Mail.php";
$from = "xxx Support <$sender>";
$to = "$to";
$subject = "$subject";
$body = "Dear $fname,\n\n$note\n\n\nYou are getting this email because you registered on our website www.xxx.com and agreed to our Terms and Conditions which includes to receive email from us at any time to your email address $to.";
$host = "smtp1.xxx.net";
$username = "no_reply@xxx.net";
$password = "4t46546$#@?";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
}
// Show sent emails.
echo "$row[fname] $row[lname] ($row[email])<br>";
}