Sending small batches via browser & mailqueue throttle

Solutions for other phpList version 2 users
Forum rules
Please do not ask questions here, this is for Solutions you have discovered or come across.

Sending small batches via browser & mailqueue throttle

Postby DaWiddoPig » 7:35pm, Tue 11 Oct, 2011

I like phplist for many reasons, but it can be hard to understand how it works and how to use it.

This post summarizes the method that I have used to send a monthly newsletter to several thousand email addresses via browser queue processing. This may be helpful to those who want to use phplist in a similar manner and do not have a clue about cron jobs and the like.

* I have a shared host setup that limits me to 500 emails per hour, but I want to send at a far lower rate to avoid getting tagged for blasting messages at gmail, yahoo, hotmail, etc. too quickly. If I can send one message a minute, my list is done in two days. I am happy.

* I set my desktop OS power settings to either "always on" or "presentation" power mode, while I am processing with phplist, so that it does not shut down or stall in the middle of the process. (I do not know, if this matters, but it is a precaution borne of technical ignorance.)

* I process the message using a different browser. I use Internet Explorer (IE) to send the newsletter out via phplist. I go about my business and use Firefox for other things. If I were to need to interrupt the mailing, I have administrative access via Firefox. (Browsers are interchangeable)

* I prepare my newsletter, test it, etc. until it is ready. For production within IE, I make sure that the target mailing list is active, queue up the message, and then process the queue. IE shows the little bar sliding back and forth with announcements on progress below.

* The hard part to figure out was how to set up the config.php file for sending via a browser. The comments in the config file, numerous messages on this forum and the documentation provide all sorts of contradictory information. These posts were more illuminating than others:
http://docs.phplist.com/PhpListConfigSendRate
viewtopic.php?f=15&t=8749&hilit=Search%E2%80%A6+throttle

* It seems like browser processing is a repetitive batch process that responds to these config.php parameter settings. (These comments are from reading and experimentation. The interpretation may be wrong, but they worked for me.)

* These settings in config.php are important:

define("MAILQUEUE_BATCH_SIZE",a-number);
define("MAILQUEUE_BATCH_PERIOD",a-number);
define('MAILQUEUE_THROTTLE',a-number);
define('MAILQUEUE_AUTOTHROTTLE',a-number);

Some of the confusion arises, because the config.php file talks about batch size and batch period relative to the maximums allowed by a shared host ISP, but those are not the numbers you use. You simply need to keep in mind what the maximums are for your ISP to stay well with their maximums. (phplist can act like a giant, high pressure fire hose unless you limit its send rate.)

If you set this:
define("MAILQUEUE_BATCH_SIZE",4);
then phplist will pick 4 emails from your list for each batch. It will keep processing one batch of 4 after another batch of 4 until it processes the entire list. A list of 4,000 emails would mean 1,000 batches. (I am not sure how efficient these repeated small batches are regarding server processing, but I doubt this matters.)

If you set this
define("MAILQUEUE_BATCH_PERIOD",120);
then phplist will process the 4 emails in each batch in 120 seconds or 2 minute. As I understand it, all four get blasted out in the first nano-second that the batch runs. (By the way, it is not clear whether phplist will process the first batch in the first two minutes, got to sleep for the next two minute, and then process the second batch in the third two minute interval versus processing a batch every two minutes, as some have suggested.)

If you set this
define('MAILQUEUE_THROTTLE',15);
then phplist will process the 4 emails in each 120 second batch by spacing out the sending by 15 seconds. Thus, apparently the 4 emails are sent individually at 0 seconds, 15 seconds, 30 seconds, and 45 seconds. Then phplist waits until the end to the 120 second period before setting up a new batch. This would seem to mean that batch size=4 times throttle=15 should not exceed batch period=120, but I am guessing that even if it did a message in the batch would just not get sent and that message would get picked up in later batch.

Because I set the throttle to 15, I used 0 with this:
define('MAILQUEUE_AUTOTHROTTLE',0);
config.php says that setting this to a 1 would spread the 4 messages out over the 120 seconds, but that it will only work with the regulare mailqueue_throttle set to 0 (that is turned off.)

Obviously, the numerical settings above are what you choose them to be. Originally, I used much larger numbers closer to the ISP maximums, but little would get done. There was probably some time out occurring somewhere that messed things up. Using smaller batches and shorter periods, seemed to solve the problem.

* Because you are going to send at a slow rate of no more than a couple of messages per minute, these domain-level throttle settings are probably redundant and they are turned off with zeros on "use" and "auto"

define('USE_DOMAIN_THROTTLE',0);
define('DOMAIN_BATCH_SIZE',1);
define('DOMAIN_BATCH_PERIOD',10);
define('DOMAIN_AUTO_THROTTLE',0);

Since you are sending messages much slower than phplist could or that your ISP might allow, which are randomly selected from your list you are much less likely to get on the bad side of gmail, yahoo, hotmail, etc.

* By the way, if you set:
define('SEND_QUEUE_PROCESSING_REPORT',true);
then this will cause phplist to send an email report to the administrators email address for each batch of 4, which would result in 1000 emails to the administrator. Changing "true" to 0 or false is a good idea.

To conclude, phplist is a great product, but the downside is user confusion. Hopefully this message will help browser queue processing users to get phplist to work.

I have no plans to track this forum thread, so please correct and embellish, as you wish, but do not expect a response, since I am not an active forum visitor.
DaWiddoPig
phpList newbie
 
Posts: 3
Joined: 5:45am, Thu 07 Jul, 2011

Re: Sending small batches via browser & mailqueue throttle

Postby oyunar » 11:37am, Fri 20 Jul, 2012

define('SEND_QUEUE_PROCESSING_REPORT',true); changing it to false is a good idea, i agree.
oyunar
phpLister
 
Posts: 11
Joined: 5:17pm, Mon 16 Jul, 2012
Location: http://www.oyunsokagi.com

Re: Sending small batches via browser & mailqueue throttle

Postby dmfrance » 5:51pm, Tue 13 Nov, 2012

Hello,
thank you, all very helpful.

I'm sorry I'm an absolute beginner and would need somebody to help me through each step...

I understood everything so far, downloaded Filezilla to look into the server and now am confused:

when I enter the config.php I can just open the notes
where can I make the corresponding changes to the parameters?

thanks in advance!
dmfrance
phpList newbie
 
Posts: 2
Joined: 5:43pm, Tue 13 Nov, 2012

Re: Sending small batches via browser & mailqueue throttle

Postby dmfrance » 7:33pm, Wed 14 Nov, 2012

Ok, got it, just make the changes in the comments file...
dmfrance
phpList newbie
 
Posts: 2
Joined: 5:43pm, Tue 13 Nov, 2012

Re: Sending small batches via browser & mailqueue throttle

Postby francwalter » 10:25pm, Fri 01 Feb, 2013

Thank you!
francwalter
phpList newbie
 
Posts: 4
Joined: 12:13pm, Thu 31 Jan, 2013


Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests