Close

November 6, 2013

phpList and Amazon SES – Perfect together

Generally speaking, sending out bulk email to clients for purposes other than marketing, is frowned upon in most instances. Every internet provider and hosting company on the planet has some sort of “cap” where they limit you from sending a certain amount of messages within a time period (day or hour…see some various caps here).

What if your job is to send out important data that requires email like weather or emergency alerts?

Simple! Setup a webhosting account with both PHPLIST and Amazon SES. For very little cost, you can setup your own email alert system (or even low-cost marketing system).

Aside from a bit of DNS work to add SPF records for Amazon SES and a bit configuration work, the system is fairly simple to setup. You run the show, so for just the hosting and Amazon SES cost, you can have as many contacts as you would like without paying a subscription cost.

Configuration tips:

  1. PhpList Config tip:
    Along with your database setup, you will want to setup SES as an SMTP account. The main account you are sending out as NEEDS to be verified in Amazon SES. For a subdomain that will run this system entirely, (ie: hostname.com/admin/ will be the admin interface), you need to setup some extra config variables like “pageroot” and “adminpages”.

     
    define("PHPMAILERHOST",'email-smtp.us-east-1.amazonaws.com');
    $phpmailer_smtpuser = 'smptuser';
    $phpmailer_smtppassword = 'supersecretpassword';
    define('PHPMAILERPORT',465);
    define("PHPMAILER_SECURE",'ssl');
    $message_envelope = "[email protected]";
    # Send a batch of 360 messages per batch period:
    define("MAILQUEUE_BATCH_SIZE",14400);
    # batch period is set to 3600 seconds (=1 hour):
    define("MAILQUEUE_BATCH_PERIOD",3600);
    define('MAILQUEUE_THROTTLE',1);
    $pageroot = '/';
    $adminpages = '/admin/';
  2. Make sure you know the structure of your site before hand. (ie: hostname.com/phplist OR alerts.hostname.com/admin). Setting up PHPList and then changing the structure later is a bit of a chore. We had to hand edit Unsubscribe Urls etc, directly within the database itself.
  3. Test..Test..Test some more. Before you go live with a post, make sure you setup a Test subscriber list and send yourself a few emails. Check all of the opt-out and subscription links.

While PHPList has a few quirks, we felt that the system was perfect for any number of uses. E-Marketing companies like Constant Contact and Mailchimp are lowering their prices, we felt that this was a great system to have, especially if it is going to sit unused at times. That way you are not paying for any subscription fees.

UPDATE 6/3/2015:
If you are having trouble getting this working, try commenting out very first PHPMAILERHOST definition in your config file.
Also absolutely make sure that you have the correct mail port listed on your server (25 or 587 or 465). The “465” seems to work best in most of our cases, but your mileage may vary.

#define("PHPMAILERHOST",'');

As always, be sure to if you have any questions or would like us to setup a system for your own needs.