punch_card_don has asked for the wisdom of the Perl Monks concerning the following question:

Metallic Monks,

I'm thinking of using MIME::Lite::TT::HTML behind a user-management system's "email upates to all users" button. Hit the button, and the lastest update gets emailed to ~1,000 registered users.

I seem to recall something about taking care in such processes not to overload the mail server by spitting out too many mails too quickly. But I see nothing in MIME::Lite::TT::HTML specifically designed to meter the mails out.

What's good practice?

Thanks




Forget that fear of gravity,
Get a little savagery in your life.
  • Comment on MIME::Lite::TT::HTML, time control for mass mailings?

Replies are listed 'Best First'.
Re: MIME::Lite::TT::HTML, time control for mass mailings?
by perrin (Chancellor) on Jul 01, 2007 at 05:28 UTC
    1000 e-mails? Any server should be able to handle that. Don't worry about it.
      You could build in a few seconds time delay after 100+ emails to allow for catch up
        Ya, that's sort of what I had in mind.

        So woud it best to sleep my mailing script, say something like this:

        $i=0; foreach $user (keys %users) { prep info; send mail using MIME::Lite::TT::HTML $i++; if ($i%100 == 0) {sleep 2;} }
        Or is there some other, better way to do it?

        Thanks.

Re: MIME::Lite::TT::HTML, time control for mass mailings?
by ww (Archbishop) on Jul 01, 2007 at 14:16 UTC
    Sounds like you're on a workable track, but is there any reason not to batch them, with 5 or 10 addressees per email? Bcc if non-identification of other users is important, but batching, if I understand correctly, should reduce the workload on the server, at least to some extent, again, IIUC, especially is using SMTP rather than SENDMAIL..

    And as to your timing issue: if your host (or admin if you own the server) sets limits, it should be easy to work out a value for $time if you use sleep($time).