PHP Classes

Bulk Email in 2019

Recommend this page to a friend!

      MIME E-mail message sending  >  All threads  >  Bulk Email in 2019  >  (Un) Subscribe thread alerts  
Subject:Bulk Email in 2019
Summary:Is this still the best solution in 2019?
Date:2020-02-19 08:28:35

  1. Bulk Email in 2019   Reply   Report abuse  
Picture of Andrew Andrew - 2020-02-19 08:28:35
Hello Manuel,

Is this still the best solution in 2019? I need the ability to send 600,000 email per month since we do not want to rely on Mailchimp. We send out emails with a different subject and body to different email address's. Is there a better solution?

Thank You.

  2. Re: Bulk Email in 2019   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2020-02-19 16:27:20 - In reply to message 1 from Andrew
Hello Andrew that is a good question.

In the PHP Classes site we use this package in conjunction with a qmail mail server to send over 3 million newsletter messages a month in a single dedicated server running a regular Linux distribution. If you want to build a similar solution we can try to help you as we have been using this reliably for many, many years.

  3. Re: Bulk Email in 2019   Reply   Report abuse  
Picture of Andrew Andrew - 2020-02-21 06:27:57 - In reply to message 2 from Manuel Lemos
Hello Manuel,

Thanks for your reply. I just checked our managed VPS. We do not have qmail installed. We have sendmail and exim installed.

I read your mimemessage post about bulk email. One of the problems you listed there about API cloud mailing is very true. We're finding it expensive to send 100,000 emails.

Our emails are not newsletters. They are emails triggered in the social network between users. The subject and body are different for every user. We currently send emails to the mailgun API on our site The advantage with mailgun is that emails are sent with the mailgun IP. If a user were to click on SPAM, our IP remains unaffected.


SPF: PASS with IP -> This is the mailgun IP.
DKIM: 'PASS' with domain

Received-SPF: pass ( domain of bounce+25 designates as permitted sender) client-ip=;


So, to do something similar where we do not expose our IP, we need to install your script on a separate server.

I will list the main requirements:

1) Run the script on a different IP/domain.
2) How do we send emails to your script from hobotraveler? Some kind of a POST API? And then your script would send the emails to the queue? or maybe we insert the emails in a database and your script would fetch from the db?
3) How would bounce detection work. Add MX records?
4) Stop sending any new emails to bounced emails so that the IP reputation is not flagged as a spammer.

Let me know if you have a different strategy and the price to setup the script etc. My emails is in my profile.


PS: I did not receive an email when you replied.

  4. Re: Bulk Email in 2019   Reply   Report abuse  
Picture of Andrew Andrew - 2020-02-23 04:53:09 - In reply to message 2 from Manuel Lemos
Hello Manuel,

I was looking at your mimemessage class.

Do I use test_personalized_bulk_mail.php and iterate through the while loop all the results from the db? Is it recommended to iterate through 100,000 users this way?


  5. Re: Bulk Email in 2019   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2020-02-25 01:21:26 - In reply to message 3 from Andrew
You may use other types of email servers like postfix, sendmail or exim. They may not be as efficient as qmail but they can be able to send many emails at a good rate. PHP just sends messages to the local queue of those programs. Then those programs handle their queue as soon as possible.

There is a sub-class specialized in using sendmail. Other mail server programs try to emulate sendmail, so they are compatible. Just use that sub-class in your PHP application to deliver messages to the local queue using PHP.

If you do not send spam, you should not be concerned with IP reputation. You just need to follow good practices to subscribe and unsubscribe users to those mailings.

You can check your IP or domain reputation in sites like SenderScore:

We run qmail mail server in the same server but we use several IP addresses to send regular newsletters and important email messages.

For critical messages, like those related with e-commerce notifications, we use a single Google GSuite account. It just costs $5 / month per account. We only use one account so far. We use a different domain for those critical messages. It does not guarantee that the user will always see the messages because that depends on how messages are delivered by the destination mail system, like Gmail or others.

In our newsletter mailing system we queue messages on database. Then a separate background process delivers those messages processing queued messages one by one.

We do that because some messages are sent to many users but each user receives a personalized message. So we only queue message templates and other details.

The background mailing process starts from a cron job and then it processes the template for each user that is retrieved from the database according to the type of newsletter.

The test_personalized_bulk_mail.php does more or less what I described above except that it is very simplistic as it uses arrays to queue messages.

We have a private solution that uses a process that is more efficient in terms memory. As you may be aware, PHP has memory usage limits, so you cannot keep large arrays in memory.

To handle bounces we make the Return-Path header option be set to virtual email address that is associated to a mailbox that you can access using a POP3 class that I also developed. ...

A separate PHP script polls that POP3 mailbox and parses the email to extract the bouncing address using another class that I also developed. ...

Once it extracts the bouncing email address the script that handles those bounces will flag the email address as bouncing, so no more newsletters are delivered.

You can try implementing all this by yourself, or if you prefer we can develop a custom solution for you. Just let me know if you are interested so we can give you a quote in time and money that it would cost. If you agree, then we can put it in contract and start the work.

  6. Re: Bulk Email in 2019   Reply   Report abuse  
Picture of Andrew Andrew - 2020-02-27 16:25:12 - In reply to message 5 from Manuel Lemos
Can you please let me know the cost. My email is on file. Thanks!

  7. Re: Bulk Email in 2019   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2020-02-28 05:05:28 - In reply to message 6 from Andrew
Sure. Let me talk with some developers that can help me with that.