2012-05-18 62 views
2

我使用SendGrid SMTP郵件服務從我的PHP網站發送SMTP電子郵件。一切工作正常,但是當我發送大量(5,000)時,加載/發送需要很長時間,然後嘗試重複重新啓動,並且雙倍,三倍......我錯誤地發送了30,000封電子郵件!我需要一種方法來查看郵件查詢並刪除它們,或者在執行此操作時停止該進程。通過PHP的SMTP電子郵件 - 通過發送網格

  • 我怎樣才能看到電子郵件的發送?或取消他們被送出?
  • 也許通過珍珠郵件?

這裏是我的代碼

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); 

回答

2

聽起來像您的本地腳本在管理您嘗試發送的郵件數量時遇到了麻煩。您應該實現本地隊列,並且由於您使用的是PHP,因此一個簡單的選項是Mail_Queue PEAR package

相關問題