Now that we have PHPlist installed, and we've made some adjustments to the PHPlist settings, the next step in properly setting up PHPlist is to rate limit the number of emails PHPlist sends out at one time. If this is not properly configured, PHPlist by default will attempt to send all of the emails at one time. On Web Hosting Hub servers, there is a limit on the number of emails that can be sent per hour (250 messages per domain, per hour). This limit is for the protection of our servers and to help prevent Spam. If your mailing list is greater than 250 email addresses, the first 250 messages would be sent, but the remaining messages would not.
Please note, if you have a need to send more than 250 emails per hour, you can submit an Email Limit Exception Request through AMP. Requests are handled on a case by case basis.
Due to the hourly limit on email messages, it's a good idea to allow for other regular emails you may want to send during that time frame. For instance, if you regularly send 5-10 emails per hour, you will want to set the rate limit in PHPlist to 240 or less.
- If you are not still logged into your cPanel, begin by logging into your cPanel account.
- Click on the File Manager icon under the Files section in your cPanel home screen.
- To access the PHPlist configuration file (config.php), navigate to the config directory inside of the directory you installed PHPlist to. Using our example, we installed PHPlist to the directory named newsletter inside our main domain's document root so we need to navigate to public_html/newsletter/config/
- Open the config.php for editing by either right clicking and selecting one of the edit options (Edit or Code Editor) or clicking on one of the edit options at the top of the File Manager screen. If you receive an encoding check pop-up window, make sure utf-8 is selected before clicking the Edit button in that window.
- The PHPlist configuration file contains a lot of information. While at first glance, it can be easy to get overwhelmed, fortunately we will only be focusing on a few lines that need to be edited. You will want to look for each of the following two lines:
- Make sure you locate the lines that do NOT begin with the pound sign (#). In the following example we have highlighted the two lines that you will want to edit:
- There's some information you will want to keep in mind when determining BATCH_SIZE and BATCH_PERIOD.
BATCH_SIZE = the number of emails that will be sent in each batch.
BATCH_PERIOD = the time to wait (in seconds) between batches. Five minutes (300 seconds) is a good wait period so we will set BATCH_PERIOD to 300.
We will need to do a little math to determine our BATCH_SIZE. The basic formulas (in seconds) are:
3660 / BATCH_PERIOD = # of batches
(60 seconds X 60 minutes = 3660 seconds in an hour)
Desired Hourly Limit / # of batches = BATCH_SIZE
(BATCH_SIZE needs to be a whole number, so you may need to round your result up or down)
For our example, we want to keep the emails sent out by PHPlist to approximately 200 emails per hour and we've chosen a BATCH_PERIOD of 5 minutes (300 seconds).
3660 / 5 = 12
200 / 12 = 17 (rounded up from 16.666...)
So, for our example we will set our BATCH_SIZE and BATCH_PERIOD as follows:
- That's it for our changes to the configuration file. In the upper right corner of the edit window, click the Save Changes button and then the Close button.
When we get to our article on sending a message to our mailing list, we'll be able to see our rate limiting in action.