How to edit batch settings in phpList
- Log into your cPanel
- Access your File Manager by clicking the “File Manager” icon.
- Navigate to the directory you installed phplist into. Then navigate to the config directory within that. From there, right click on config.php and click edit. If you’re prompted with a “Text-Editor” window, ensure “utf-8” is selected in the drop down and then click “Edit”
- You are now looking at the phpList configuration file. There is quite a bit of content in this file, your focus is on finding these two lines:
define("MAILQUEUE_BATCH_SIZE",0); define("MAILQUEUE_BATCH_PERIOD",100); Change these values to what we have below: define("MAILQUEUE_BATCH_SIZE",17); define("MAILQUEUE_BATCH_PERIOD",300);The changes that we made told phpList to send 17 emails every 300 seconds (5 minutes).
- Click “Save Changes”.
# batch processing # if you are on a shared host, it will probably be appreciated if you don’t send # out loads of emails in one go. To do this, you can configure batch processing. # Please note, the following two values can be overridden by your ISP by using # a server wide configuration. So if you notice these values to be different # in reality, that may be the case ## if you send the queue using your browser, you may want to consider settings like this ## which will send 10 messages and then reload the browser to send the next 10. However, this ## will not restrict the sending to any limits, so there’s a good chance you will ## go over the limits of your ISP # define(“MAILQUEUE_BATCH_SIZE”,10); # define(“MAILQUEUE_BATCH_PERIOD”,1); ## if you send the queue using commandline, you can set it to something that complies with the ## limits of your ISP, eg 300 messages an hour would be # define(“MAILQUEUE_BATCH_SIZE”,300); # define(“MAILQUEUE_BATCH_PERIOD”,3600); # and then you need to set the cron to run every 5 minutes # define the amount of emails you want to send per period. If 0, batch processing # is disabled and messages are sent out as fast as possible define(“MAILQUEUE_BATCH_SIZE”,17); # define the length of one batch processing period, in seconds (3600 is an hour) # Please note: this setting has two consequences: # 1. it will enforce that the amount of emails sent in the period identified here does not exceed the amount # set in MAILQUEUE_BATCH_SIZE # 2. there will be a delay of MAILQUEUE_BATCH_PERIOD when running the queue. # # number 1 is mostly when using commandline queue processing (strongly recommended) # number 2 is when using browser queue processing. The browser will reload to send the next # batch after the amount of seconds set here define(“MAILQUEUE_BATCH_PERIOD”,300);
How does rate limiting work in phpList?Later in our tutorial series, we’ll show you how to send a message to a mailing list in phpList. Because we’re talking about rate limiting right now, we’d like to give you a sneak peak at what it will look like when you send to 400+ users with the above options set. We initiall sent a message to our list at 9:20 am. The confirmation message below mentions that phpList sent 17 emails, and then will wait 300 seconds (5 minutes) before sending more.
Started Sending in batches of 17 emails Processing has started, 1 message(s) to process. Please leave this window open. You have batch processing enabled, so it will reload several times to send the messages. Reports will be sent by email to firstname.lastname@example.org Processing message 7 Looking for users Found them: 403 to process batch limit reached: 17 (17) Script stage: 5 17 messages sent in 4.38 seconds (13961 msgs/hr) Finished this run Waiting for 300 seconds before reloadingAfter 5 minutes (it is now 9:25 am), your browser will reload, and you will see another message similar to the below. This message states that in the last run 17 messages were sent, and another 17 messages have been sent now:
Started Sending in batches of 17 emails Sent in last run: 17 Skipped in last run: 0 Processing has started, 1 message(s) to process. Please leave this window open. You have batch processing enabled, so it will reload several times to send the messages. Reports will be sent by email to email@example.com Processing message 7 Looking for users Found them: 386 to process batch limit reached: 17 (17) Script stage: 5 17 messages sent in 0.51 seconds (119386 msgs/hr) Finished this run Waiting for 300 seconds before reloadingAt this point, you simply need to leave your browser open. Every 5 minutes, your browser will reload and another 17 emails will be sent.