best way to send newsletter

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

best way to send newsletter

Post by yacahuma »

Hello,

WHat is the best way to send a newletter for 4000 emails

1. get all the mail in one select and use batch send

or

2. use limit to get X number of records and run the cron every 5 minutes



Are there better options?

Thank you
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: best way to send newsletter

Post by Chris Corbyn »

Anything over 100 emails, Cron. This has been asked many times before ;)
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: best way to send newsletter

Post by yacahuma »

Both are in a cron. What I am saying is if I should use a select limit or let swiftmailer get all of them at once?

I guess you are saying use the limit?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: best way to send newsletter

Post by Chris Corbyn »

Ah I see. Definitely limit the number of emails in any single batch yes. You'll scale far better if you apply limits.
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: best way to send newsletter

Post by yacahuma »

what about the Throttler Plugin? Why not load the 3000 mails and then use this plug in? Pros and Cons?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: best way to send newsletter

Post by Chris Corbyn »

yacahuma wrote:what about the Throttler Plugin? Why not load the 3000 mails and then use this plug in? Pros and Cons?
Well, the throttler in combination with the anti-flood plugin will work (or even just anti-flood alone).

Pro's: It's simple to write and manage.
Con's: The load caused by the script may be high. If the script dies, your entire batch does. A cron would get a second (read, multiple) chances.

Don't get me wrong. AntiFlood and Throttler were developed for that exact reason, but I'm an honest guy and I have to admit that I'd personally choose cron over my own plugins :P The plugins are solid though (those particular ones have never had any problems). It's a matter of preference I guess.

PHP (not swift) is known to leak memory too when it's run for a long time unfortunately.
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: best way to send newsletter

Post by yacahuma »

Thank a lot. I will go with the limit route and run the cron every 5 minutes.

Maybe load 500 mails per batch.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: best way to send newsletter

Post by Chris Corbyn »

I think that's reasonable :) Though I'd double that with the anti-flood plugin to restart the connection at each 100 emails (since 100 is often a limit-per-connection).
Post Reply