SendGrid SMTPメールサービスを使用して、PHPWebサイトからSMTPメールを送信しています。すべて正常に動作しますが、大量(5,000)を送信すると、読み込み/送信に時間がかかり、何度も再起動を試み、2倍、3倍、....誤って30,000通のメールを送信しました。メールキューを表示して削除するか、これが行われたときにプロセスを停止する方法が必要です。
- 送信される電子メールのキューを確認するにはどうすればよいですか?または、送信をキャンセルしますか?
- たぶんパールメールを通して?
これが私のコードです
require_once "Mail.php";
$from = $thom5;
$to = $allemailsever1.','.$thom5;
$subject = $_POST['subject1'];
$html = "
<html><body>
<p></p>
$thom
</body></html>
";
$host = "smtp.sendgrid.net";
$port = "587";
$username5 = "";
$password5 = "";
$mime = '1.0';
$content = 'text/html';
$charset="ISO-8859-1";
$three = 'Receipients <'.$thom5.'>';
$headers = array ('From' => $from,
'To' => $three,
'Subject' => $subject,
'Mime-version' => $mime,
'Content-Type' => $content,
'charset' => $charset);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username5,
'password' => $password5));
// Send notification //
$mail = $smtp->send($to, $headers, $html);