向订阅者发送大量电子邮件的最佳方式(BCC 或 PEAR 邮件队列?)

发布于 2024-09-03 13:38:07 字数 1229 浏览 5 评论 0原文

我需要向我的 5000 名订阅者发送电子邮件。 最好的方法是什么?

1) 通过使用密件抄送 ?:

  $from_addr = '[email protected]';
  $mailing_list = '[email protected]', '[email protected]', '[email protected];
  $message_subject = 'this is a test';

 `$headers = array ("From" => $from_addr,
                    "Bcc" => $mailing_list,
                    "Subject" => $message_subject);

  $smtp = Mail::factory("smtp", array ('host' => "smtp.example.com",
                                       'auth' => true,
                                       'username' => "xxx",
                                       'password' => "xxx"));

  $mail = $smtp->send($email, $headers, $message_body);`

2)通过使用PEAR邮件队列?

I need to send email to my 5000 subscribers.
What is the best way to do this ?

1) By using BCC ?:

  $from_addr = '[email protected]';
  $mailing_list = '[email protected]', '[email protected]', '[email protected];
  $message_subject = 'this is a test';

 `$headers = array ("From" => $from_addr,
                    "Bcc" => $mailing_list,
                    "Subject" => $message_subject);

  $smtp = Mail::factory("smtp", array ('host' => "smtp.example.com",
                                       'auth' => true,
                                       'username' => "xxx",
                                       'password' => "xxx"));

  $mail = $smtp->send($email, $headers, $message_body);`

.

2) by using PEAR mail queue ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烟沫凡尘 2024-09-10 13:38:07

我还没有使用过 PEAR mail_queue,但使用队列绝对是最佳选择!
不应使用密件抄送,因为您的邮件很容易被 gmail/hotmail 等大型电子邮件提供商标记为垃圾邮件。
在电子邮件标头中包含数千个地址似乎很疯狂。甚至可能有一个限制。此外,某些邮件服务器可能会因为标头过大而拒绝您的邮件。最重要的是,应该发送您的电子邮件的邮件服务器不会对此感到高兴。

I haven't used PEAR mail_queue yet, but using a queue is definitively the way to go!
BCC shouldn't be used because your mails would easily get flagged as Spam by big email providers like gmail/hotmail.
Also having thousands of addresses in an email header seems to be crazy. There may even be a limit. Also some mail servers could refuse your mail because of the over-sized header. On top of that the mail server that is supposed to send your email wouldn't be to happy about it.

下壹個目標 2024-09-10 13:38:07

使用内置的 mail 功能首先并不是最好的方法。我建议你使用 SwiftMailer 它支持 HTML,支持不同的 mime 类型SMTP 身份验证不太可能将您的邮件标记为垃圾邮件。

另外,您可以查看这个 pear 包:

http://pear.php.net/package/Mail_Queue< /a>

Using built-in mail function is not the best way in the first place for that. I would suggest you to go for SwiftMailer which has HTML support, support for different mime types and SMTP authentication which is less likely to mark your mail as spam.

Also, you can check out this pear package:

http://pear.php.net/package/Mail_Queue

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文