使用PEAR / Mail_Queue发送10,000多封电子邮件的最佳方式 [英] Best way to send 10,000+ emails with PEAR/Mail_Queue

查看:548
本文介绍了使用PEAR / Mail_Queue发送10,000多封电子邮件的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个cron生成整个邮件信息,并使用 $ mail_queue-> put(.....)添加一个选项删除发送后的电子邮件。



这里是我需要一点帮助的地方:在我有以上信息后,发送电子邮件的最好方式是什么?运行 $ mail_queue-> sendMailsInQueue()使用其他cron作业或其他东西?



服务器限制方式是100个电子邮件/分钟。目前, Mail_Queue 的最后一个csv diff不适用(目前正在使用该支持),所以我不能使用delay选项。



我有一个想法,使用 $ seconds_to_send 选项,但它是基于create_time字段计算的,这不是一个大帮助,但这也是一个选择。



任何想法和建议将非常感激。

解决方案

个人来说,我会去cron的方式,因为它给失败的机会较少。说你的邮件服务器停止响应或其他原因变得不可用。或者如果您的整个网络离线了几个小时,但服务器仍在生成电子邮件。我说使用队列。



至于延迟的事情,只要有一个服务/ cronjob每六十秒接一个队列,弹出100封电子邮件并发送,然后退出。您可能会收到一系列发送的电子邮件,但无论您选择什么系统,都会发生这种情况。无论如何,队员都将在非高峰时段清空。


I have a cron which generates the whole mail info and puts in a database table using $mail_queue->put(.....) with an option to delete emails after they're sent.

Here's where I need a little help: What is the best way to send the emails after I have the above info? Running the $mail_queue->sendMailsInQueue() right away, using other cron job(s) or something else?

The server limit by the way is 100 emails / minute. Currently the last csv diff for Mail_Queue is not applied (currently working with the support on that), so I can't use the "delay" option.

I had an idea to use the $seconds_to_send option, but it's calculated on the base of create_time field, which isn't a big help, but it's also an option.

Any ideas and suggestions would be really appreciated.

解决方案

Personally, I would go the cron way because it gives less opportunity for failure. Say your mail server stops responding or for some other reason becomes unavailable. Or what if your entire network goes offline for a few hours, but the servers are still generating emails. I say use the queue.

As for the delay thing, just have a service/cronjob pick up the queue every sixty seconds, pop 100 emails and send them, then quit. You might get a queue of emails to be sent but that's going to happen no matter what system you choose. The queue will empty during off-peak hours, anyways.

这篇关于使用PEAR / Mail_Queue发送10,000多封电子邮件的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆