Forum: Ruby on Rails Doing max of N tasks per given time

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ramon T. (Guest)
on 2009-01-27 12:28
(Received via mailing list)
Hey everyone,

I need some help.  I have a Rails app on a VPS that connects to an
external SMTP server that can only send up to 250 emails per hour.  If
I try to send the 251st email, it will just ignore it.

I almost bashed my head trying to setup sendmail so I can send my own
emails, but not all emails were being sent.

I basically want to send up to 250 emails immediately, and queue the
251st email til after the next hour since the max limit of 250 will be
reset.  What can I use/install that does this for me?  If I can avoid
installing postfix and sendmail or some other MTA program, it'll be
way simpler for me.

Ramon T.
Greg (Guest)
on 2009-01-27 20:01
(Received via mailing list)
You should look into AR Mailer:

The basic idea is that rather than actually sending emails, your app
saves emails to the database.  AR Mailer then has an external script
which can be used to send these emails in batches.

Best of luck,

Ramon T. (Guest)
on 2009-01-28 06:22
(Received via mailing list)
Thanks, Greg.  I've taken a look.

I can have to Mailer models that have different uses: the first could
be for immediate emailing (forgot password, account activation, etc),
and the second, for less immediate email (site notifications,
newsletters, etc) which will be a subclass of ARMailer.

Ramon T.
This topic is locked and can not be replied to.