2012-05-18 64 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

相关问题