Simple PHP Mailing List

I was recently looking for a very simple PHP mailing list script. I essentially wanted the ability to notifiy friends and family when I’ve updated a website with new pictures. I, of course, wanted unsubscribe capability, email confirmation and other simple features. I spent WAY too much time downloading and trying out free scripts on the web. However, none of them accomplished the simple tasks that I wanted, if they even parsed correctly by PHP.

So, I decided not to waste any more of my time and just created one of my own. I wanted to keep it simple, so all the data is stored in a flat file. No database necessary. This is either a flaw or a feature, depending on your perspective.

My resulting script turned out very well. I used phpMailer to handle the mail transport. This also lets me completely customize how I want to send messages. Many scripts I saw rely on the ability to execute /sbin/sendmail. However, on many hosting providers, this is not available. So, I use phpMailer to authenticate through my email provider’s SMTP host. I can even change the port number.

The other thing I wanted was a simple, clean integration with my site. I didn’t want to fool with inline frames or creating another css file for the mailer. So, with my script, you can put the form wherever you like on your site. As one of the fields, set the hidden ‘callback’ flag. This will cause the script to return to the calling page with a result message (like: ‘user@domain.com has been subscribed.’) Then, you do whatever you want with it.

The script also has a default, no frills form that you can use or copy it into your page and modify it.

Once you are ready to send a message, just point your browser to the send message script, and type your message. You then preview the message and hit send. It gets sent as one message, adding all of the addresses as ‘bcc:.’

So, just to summarize the features:

  • Ability to completely configure your smtp server. This includes authentification and port settings.
  • Callback functionality provides a clean integration to your site
  • Subscribers can easily unsubscribe
  • No database needed
  • Easy to send messages
  • Licensed under LGPL, free for the taking

The downside is that you’re on your own for security here. However, you can easily come up with an htaccess file to password protect the email list and composer script. I’ve provided samples on how to do this with the package.

I’m open to suggestions, just leave a comment on this post. I hope you find it useful, if you do, feel free to donate a couple bucks if you want.

Download Simple PHP Mail List from Sourceforge

Advertisements
This entry was posted in PHP, Programming. Bookmark the permalink.

8 Responses to Simple PHP Mailing List

  1. S-Dog says:

    I feel like I should get some credit here. Not for any work I did…just for being your inspiration. How’s that song go?…”You’re my soul and my life’s inspiration…without you baby, what good am I?”…yeah something like that would be fine…uh, without the “baby”.

    ~S-Dog

  2. Jason says:

    Yes, of course, I must give credit to my good friend “S-Dog”, who gave me the idea that I needed a simple mailing list for my site. At the time I just didn’t realize that I would have to write my own. Thanks S-Dog!

  3. Leeor_Net says:

    I searched for hours in the internet looking for a good yet simple and PLAIN PHP mailing script that users could subscribe to and unsubscribe to. I was also looking for a solution that didn’t use a MySQL DB because I didn’t need to have overly complex scripts. Plus, many of the solutions that I *did* find had CSS styles and all sorts of annoying ‘themes’ which was WAY more than what I needed. I’m not experienced with PHP so writting a script myself would have been a daunting task at best. Long story short, this script saved a lot of frustration and a lot of MONEY as I didn’t need to add a new SQL DB (or tack on to an existing one). It’s simple, it’s clean and it does exactly what it needs to do without extra ‘features’ that get in the way. There should be more ‘simple’ projects like this one! Thank you for creating such an awesome yet simple script!

  4. goodorient says:

    This is what I’m using as well, it’s super simple and with basic php knowledge, you can customize and add stuff to it. For me I added an extra layer of protection inside instead of using .htaccess. Just found them through http://www.php.net and it’s easy peasy.

  5. Duk3 says:

    Great tool!

    I find it incredibly easy to understand, highly organized, and totally utilitarian. I am very new to scripting and I was wondering if you would be able to give me details on how to use this to send html. I have phpmailer installed and configured correctly to send html, but I want to use your system. I have it configured correctly to send to a .csv mailing list, but I don’t see how to make it send html.

    I would very much appreciate your help if you feel like hooking me up. I will continue to try and figure it out on my own.

    Thanks again for what you’ve already provided to all of us on the internet!

  6. Duk3 says:

    Hey – to Mr. York and your readers.

    this is clearly a follow-up to the previous post

    I solved my own issue… I had only needed to go into the PHPMailer folder that is included with the .zip distribution and edit the “class.phpmailer.php” file to specify the content type as “text/html.” (duh)

    Thanks again! I spent a long time searching to find this great work of yours and now I can stop, fully contented!

  7. Pete says:

    Thanks for the script. I was looking for something small, yet versatlie enough to integrate into the CMS i use, and I think I should be able to make this one work very nicely.

  8. Jonas says:

    Great work. Something really simple and useful. Where’s the flatter button to click on?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s