How to build your own email marketing service with phpList

phpList logo
(Image credit: phpList)

Mailing list management software phpList is easily one of the most important and influential pieces of software written in PHP. For over 22 years, programmers have been using phpList as a library for sending bulk emails, newsletters, and advertising to their subscribers.

phpList has expanded to support targeted emails, personalized messaging, subscribing and unsubscribing, intelligent email bounce processing, automatic spam complaints processing, and email campaign analysis. 

Commercial phpList hosting is available. However, you can save money and get better control over your email marketing if you install the open-source phpList on your own web hosting. To help you in this endeavor, we’ve partnered with Hostinger to offer a free hosting package to TechRadar readers.

Step 1: Set up an SMTP server for sending emails

Shared hosting accounts on Hostinger must use an external SMTP email server to send emails. In our example, we used a Google account which allowed us to send emails through its servers from phpList. You can skip this step if you use Hostinger’s virtual private server (VPS) plans, as Hostinger automatically includes SMTP email sending on these plans.

Sign up for a Google account or use your existing Gmail account. Once logged in, click on your profile picture, and choose Manage My Google Account. Click on Security and then App passwords.

Click Select app and click Other. Enter phpList and click Generate. Make a copy of the generated password, as it will be used again in step 3.

Screenshot of a Google app password being generated

Google requires you to make an app password for applications sending emails through its service. (Image credit: Hostinger)

Step 2: Install phpList with Auto Installer

The installation of phpList’s files is made simple on Hostinger by using its Auto Installer. Log in to your Hostinger website administration panel and choose Website from the menu on the left. Find Auto Installer, select Other, and choose phpList from the drop-down.

On the first step of the installer, set an administrator username and password. Optionally, you can set phpList to be located in a subdirectory on your hosting. You can also choose to use an existing MySQL database or to create a new one exclusively for phpList.

The second step of the installer simply asks which version of phpList you want to install and how often you want the software to update automatically. Click Install.

Screenshot of the second page of the phpList Auto Installer on Hostinger

Select the version of phpList you want to install in the Hostinger Auto Installer. (Image credit: Hostinger)

Step 3: Set your SMTP settings in phpList

You will now set the SMTP settings that phpList will use to send emails. Again, this step is only required for shared hosting on Hostinger and can be skipped if you have a VPS plan.

In the Hostinger admin panel, choose File Manager from the menu and browse to the folder where you installed phpList. Enter the folder named config, and double-click config.php to begin editing it.

Under the line //define('PHPMAILER_SECURE', false); add the following:

define("PHPMAILERHOST",'smtp.gmail.com'); $phpmailer_smtpuser = '[email protected]'; $phpmailer_smtppassword = 'your_app_password';

Change [email protected] to your real Gmail address, and your_app_password to the password generated in step one.

Click the save icon at the top right to save the file.

Screenshot of the config.php file being edited

Enter your Gmail account name and the app password generated earlier. (Image credit: Hostinger)

Step 4: Log in to phpList

Return to the Auto Installer web page in the Hostinger admin panel. Right-click on phpList in the list of installed applications and choose Manage. This will bring you to the phpList administrator login page.

Log in to phpList using the administrator username and password you created earlier.

Screenshot of the phpList login page

Enter your Gmail account name and the app password generated earlier. (Image credit: Hostinger)

Step 5: Import your email subscribers

To get started with phpList, you’ll need a list of subscribers to send emails to. Click on Subscribers in the main menu and choose Import subscribers. You have several options for importing long lists of subscribers and their accompanying information.

The simplest method here is to choose to copy and paste a list of email addresses. Select the lists you want these email addresses to be added to and enter them all, one per line, in the box below.

Click Import subscribers, and the email addresses will be added to the list.

Screenshot of the Import subscribers page in phpList

Besides entering emails in a list as we do here, you can also upload CSV files of subscribers. (Image credit: Hostinger)

Step 6: Send your first email newsletter

Click on Campaigns and choose Send a campaign. You’ll be presented with a five-step wizard for creating and sending a meaningful email campaign.

First, set the email content and then choose whether it will be HTML formatted. Schedule when and to whom the email will be sent. Finally, add optional special features like analytics code.

At any time, you can send a test copy of the email to see how it will appear to your readers.

Screenshot of the Scheduling tab of the Send a campaign wizard

phpList offers a lot of choices when scheduling your email campaigns. (Image credit: Hostinger)

Summary

phpList is a powerful email marketing tool. The easiest way to set it up is to use a hosting plan that supports email sending, such as a Hostinger VPS plan. However, you can use it on most shared hosting plans if you set it up to use an external SMTP email, as we did above.

Email marketing has been shown to offer an outstanding return on investment—$30-$40 for every $1 spent. phpList competes with the best email marketing software available today and could be just the ticket you need for sending successful email campaigns.

Read more in this series:

Richard Sutherland

Richard brings over 20 years of website development, SEO, and marketing to the table. A graduate in Computer Science, Richard has lectured in Java programming and has built software for companies including Samsung and ASDA. Now, he writes for TechRadar, Tom's Guide, PC Gamer, and Creative Bloq.