phpMassMail Documentation

Welcome to phpMassMail, a simple script which will allow you to send customised copies of an email to a complete list of email addresses.

I have split things up a little below, so please use the navigation on the right to locate the section you are looking for.


  • PHP 4.1 + (uses the new super-globals)
  • PHP configured with the ability to send email (mail() function must work)
  • Ability to create text/csv files for the messages and email list


Installing phpMassMail really just consists of unzipping the archive and copying the file “phpMassMail.php” to a location where you can access it via your webroot. This means that you need to put it somewhere that your webserver can serve it up, and then make sure that you can access it “remotely”.

You should also consider securing it if your server is publicly accessible (as opposed to an intranet/local server). I would suggest using something like Apache’s htaccess system to secure a directory and place the phpMassMail.php file in there.

Format of the Email List File

The list of email addresses you supply to phpMassMail should take the following format (exactly!)

emailAddress,theirName,custom1,custom2 ... custom9

Where you can enter anything you like in the “customX” fields, which makes the script good for things like emailing usernames/passwords to people or something like that.

Each entry should be on a new line.

Format of the Message File

The actual message file should be written in plain text. You will find that if you write the message in MS Word or a similar word processor and then copy it into Notepad (or another text-editor), then you will end up with some strange characters (due to ‘Smart-quoting’ of double-quotes and other ‘features’).

So – write your message in a plain text editor, and you can substitute in the following self-explanatory “keywords” which will be replaced with the appropriate values each time the email is sent.


Be Aware…

One thing I have noticed is that some mail servers have a defined limit on the number of messages they will handle from one sender within a certain amount of time. If your mail server is configured like this, then you will find that the script will fail sending messages after a certain point. I don’t know of any good way around this, so the operation of this script is currently subject to this restriction.