In our previous article, we installed phpList. Before we continue with creating a mailing list that users can subscribe to, there are some default settings that we must change within the phpList configuration.

By default, phpList will attempt to send out as many emails as fast as possible. To prevent possible issues with spam, accounts on our shared servers have a limit set to the maximum number of emails that can be sent per hour. That limit is set to 250 per domain per hour. What this means is that if you have 700 people in your mailing list and you try to send all of the emails at once with phpList, 250 emails will be sent and the other 450 will fail. To resolve this issue, we need to tell phpList to only send 250 emails per hour.

Please note that we do on a case by case basis increase this number for our users. If you're interested in being able to send more than 250 emails per hour per domain, please see our Bulk Mailing Request article.

Please also keep in mind that if you normally send 10 emails per hour during your daily routine, then you may need to set phpList to only send 240 emails per hour. In the example below, we will walk you through the steps to configure phpList to send 204 emails per hour at a rate of 17 emails every 5 minutes.

How to edit batch settings in phpList

  1. Log into your cPanel
  2. Access your File Manager by clicking the "File Manager" icon.
  3. 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"
  4. 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).
  5. Click "Save Changes".

Please be aware that you will see the above lines several places in the config file. Please be sure to edit the lines that do not start with a pound sign. There is only one line for each setting that does not begin with #.  In the example below, the green lines are where we made the edit, and the red lines are where we DID NOT make any edits due to the line starting with #.

# 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 listreports@phplist.inmotiontesting.com
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 reloading

After 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 listreports@phplist.inmotiontesting.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 reloading

At this point, you simply need to leave your browser open. Every 5 minutes, your browser will reload and another 17 emails will be sent.

What happens if my browser closes during sending of my messages?

We had the same question. Right now we're in the middle of sending 400+ emails at a rate of 17 emails every 5 minutes. We've already sent about 51 emails, and we just closed our browser. With the browser closed, phpList will not be able to process the rest of the messages we need sent.

To continue sending your list, simply log back into you phpList admin and click the "process queue" link in the right sidebar:
in-phplist-click-process-queue

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

News / Announcements

WordPress wp-login.php brute force attack
Updated 2014-07-17 06:43 pm EST
Hits: 201664

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!