PHP发送大量邮件:每个一个或一个一个?

使用PHP发送大量邮件时,最好是向每个订阅者发送一封电子邮件(在所有电子邮件地址中运行for循环),还是最好只在逗号分隔列表中添加所有BCC,从而仅发送一封电子邮件? 谢谢。     
已邀请:
BCC字段中的地址数量很可能在SMTP服务器上受到限制(以避免发送垃圾邮件)。我会选择安全路线并向每个订户发送电子邮件。这样还可以根据需要为每个订户自定义电子邮件。 另请注意,mail()可能不是发送批量邮件的最佳方式(因为每次调用时都会打开与SMTP服务器的新连接)。你可能想看看PEAR :: Mail。     
最佳做法是每个收件人发送一封电子邮件。 如果它是一个linux邮件服务器,它可以处理大量的吞吐量,所以除非它是一个废话服务器,否则卷应该不是问题! 如果它是一个共享的网络服务器,你的主机可能会不高兴 - 如果是这种情况,我会把它拆分成块并传播发送。如果它是专用的,那么就像你一样:)     
如果由于某种原因发送过程失败(例如,原因可能是我无法解析的域)其中一个BCC收件人,整个操作将被取消(99%的情况是不需要的行为)。 我在PHP循环中发送电子邮件,即使其中一封电子邮件无法发送,也会发送其他电子邮件。     
正如其他人所说,每个收件人一封邮件更合适。 如果你想让一个库为你做脏工作,试试SwiftMailer http://swiftmailer.org 以下是直接来自文档的示例:
require_once 'lib/swift_required.php';

//Create the Transport
$transport = Swift_SmtpTransport::newInstance('localhost', 25);

//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);

//Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
  ->setFrom(array('john@doe.com' => 'John Doe'))
  ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name'))
  ->setBody('Here is the message itself')
  ;

//Send the message
$numSent = $mailer->batchSend($message);

printf("Sent %d messagesn", $numSent);

/* Note that often that only the boolean equivalent of the
   return value is of concern (zero indicates FALSE)

if ($mailer->batchSend($message))
{
  echo "Sentn";
}
else
{
  echo "Failedn";
}

*/
它还有一个很好的Antiflood插件:http://swiftmailer.org/docs/antiflood-plugin-howto     

要回复问题请先登录注册