PHP Classes

Perferred Sending for bulk personalized messages

Recommend this page to a friend!

      MIME E-mail message sending  >  All threads  >  Perferred Sending for bulk...  >  (Un) Subscribe thread alerts  
Subject:Perferred Sending for bulk...
Summary:Perferred Sending for bulk personalized messages
Author:Dave Fish
Date:2006-06-26 20:11:16
Update:2006-07-12 18:03:08

  1. Perferred Sending for bulk...   Reply   Report abuse  
Dave Fish - 2006-06-26 20:11:16
I was wondering if there is a preferred method for sending bulk personalized messages? SendMail, SMTP? Qmail?

Is one method better than another?

Also, do I need to worry about overhead when sending personalized HTML messages? Is there a max number that I should be careful of that may cause an overload of some sort.


  2. Re: Perferred Sending for bulk...   Reply   Report abuse  
Manuel Lemos - 2006-06-27 05:06:49 - In reply to message 1 from Dave Fish
SMTP is the worst method because you need to establish a SMTP connection to inject messages in a queue, while using sendmail or equivalent is the direct method to do the same.

When using bulk mailing, watch the disk space. The messages will start piling in the queue faster than the mail server can deliver them, unless message generation is very slow.

In any case also watch the CPU usage, especially if you are on a shared server. Resting for a period while the CPU is high is recommendable.

There is no fixed sending rate above which it may cause overload. You need to watch system variables to evaluate system load once in a while because the concurrent activity of the mail server and other processes also weight on the system load.

If you ever considered it, do not use lists of mail addresses that may not be able to receive it.

It is not just a matter of anti-spam ethics, but also the fact that such mailing lists may have too many no longer valid addresses that will bounce to your server, causing further excessive load to your machine, exhaust your available bandwidth and fill up your queue disk space.

Even if you are sending messages to users that voluntarily subscribed to a mailing list, keep in mind that over time most addresses become invalid, so you may need to cleanup your list and unsubscribe all invalid users before trying to send any newsletters.

Actually, you should not attempt to send messages to any address once you receive a permanent delivery failure report message.

  3. Re: Perferred Sending for bulk...   Reply   Report abuse  
Dave Fish - 2006-07-11 18:13:49 - In reply to message 2 from Manuel Lemos
Sorry for not replying for so long. I'm back to working on this again (I was side tracked for a while)

I would like to optimize my bulk messages as much as possible. I'm not sure how may we will send out, but lets say its 100-500 at a time (not personalized). Is this something sendmail can handle. I see you recommend using:

* require_once("qmail_message.php");
* $email_message=new qmail_message_class;

Is this somthing I should concider. I have qmail running on the server.

Also, how much more load would it be to send personalized messages? I should mention we are on a dedicated server with 512MB of RAM installed.

I'm not too worried about returned messages because our application verifies emails and the users account is only active for a few months. But thanks for the recommendation.

Do you know of a script for Linux boxes that checks the TO email of the incoming undeliverable mail.

Thanks again for the help.

Dave ><>

  4. Re: Perferred Sending for bulk...   Reply   Report abuse  
Manuel Lemos - 2006-07-12 18:03:08 - In reply to message 3 from Dave Fish
Sendmail is fine. You can configure it to just queue the messages instead of attempting to deliver right away. This will free your PHP script faster to send the following messages.

Personalized messages will make your PHP script spend more time, memory and CPU. Depending on the available resources in your server, it may cause overload and so it may not be worth the benefits. It is hard to tell how much load it will cause. It depends on how large are your messages.

Bouncing messages are a real problem. Even when you verify the sender address, soon or later messages will start bouncing for whatever reasons. That will cause load to your server because it has to receive the bounce messages.

Usually there is no way to tell a message will bounce because that only happens after the destination server accepts the messages.

What you can do is to set the return path address of a message to make it point to an address with a POP3 mailbox. Then once in a while you can poll that mailbox to process bounced messages.

Take a look at these classes which are the ones that I used to receive bounced messages and parse them to figure which address is bouncing: