TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Mailing queue
  • Hello, everyone

    Our project has to send emails to users. One of them is: new comments notifcation.

    One comment should be send to 100 users. Can anyone advise: how I should proccess such big amount of emails? Making queues in DBs or there is any module for CentOs/Ubuntu ?

  • You should use something like resque.

  • Use something like postmarkapp.com or mailgun.com. Just make sure your emails are transactional.

  • gearman FTW

  • Resque, rabbitmq, gearman - too hard. I send 40k-60k email messages per day. I use usual mysql table for email queue. And minion task on every-minute-cron for sending.

  • It seriously takes like 5 minutes to setup resque.

  • IMO you should not solve your queue problem at the programming language side but at the mail servers side. You could do 2 things:

    1. Setup your mailserver to send in batches. Sendmail is able to handle queuing the messages: http://www.freebsd.org/cgi/man.cgi?query=sendmail&sektion=8
    2. Use a third party mail service like pan69 suggested.

    I don't understand why you would even consider solving this in your application. Just send it to the SMTP server and let those handle the email sending.

  • @rjd22 Stuffing an outgoing email into a queue is super quick, SMTP will almost certainly be slower and could be really slow. You don't really want the users page hanging whilst you attempt to send an email.

  • @zombor 5 minutes if you know what you're doing...

  • cs278: Sending a mail into a SMTP queue shouldn't take long since it's not waiting for the email to be send. It's just receiving and closing. Exactly the same as a normal queue.

  • @rjd22 An SMTP transaction is nowhere as simple, the server will usually perform all sorts of validation, DNS lookups on the envelope addresses etc.

  • It's still a network connection, which can be slow. You should never send an email in-process.

  • I ran into this problem about a year ago. I was using the Kohana SwiftMailer module. SwiftMailer itself has support for spooling, but the email module didn't. So I went ahead and implemented it!

    I actually stopped using this method, and instead just let Exim4 handle the queuing. For my smaller application I just push the email right to Exim4 through it's sendmail-like interface, since it's running on the same machine as the web server it's really fast.

    Of course, any real bulk email processing happens in a Minion task.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion