PHP 5 Mailer Class

phpmailer

I spent about a day creating a basic mailer class until I decided that there had to be a much better implementation created by a third party. Whilst it was interesting to have to iron out the bugs in the examples I found on the internet ultimately I wanted a solid, secure platform for both myself and my customers. There are a lot of code snippets on the internet that just are not up to the job…

So, the one to use is PHPMailer from Codeworx Technologies. Find their link here and access the script from their SourceForge page

For reference my functional example is located here
Let me know if you require a more detailed explanation of how it works.

Update: this page has been getting a few views, so it is obviously something that people are interested in. As of this edit (20/05/2010) the version is 5.0.0.0

Features include:

  • Supports emails digitally signed with S/MIME encryption!
  • Supports emails with multiple TOs, CCs, BCCs and REPLY-TOs
  • Works on any platform.
  • Supports Text & HTML emails.
  • Embedded image support.
  • Multipart/alternative emails for mail clients that do not read HTML email.
  • Flexible debugging.
  • Custom mail headers.
  • Redundant SMTP servers.
  • Support for 8bit, base64, binary, and quoted-printable encoding.
  • Word wrap.
  • Multiple fs, string, and binary attachments (those from database, string, etc).
  • SMTP authentication.
  • Tested on multiple SMTP servers: Sendmail, qmail, Postfix, Gmail, Imail, Exchange, etc.Good documentation, many examples included in download.
  • It’s swift, small, and simple.

5 thoughts on “PHP 5 Mailer Class”

  1. Interesting that you ended up using a third party offering. Like you I found a lot of ‘proof of concept’ code snippets out there. To be honest, they worked (barely) but were little more than a starting point.

    So ultimately why did you choose to use someone elses tool instead of creating your own from scratch?

    CM

  2. Finally, a mail class that does what it is supposed to. Thanks for bringing it to my attention, so simple to use.

  3. It is always necessary to weigh up the flexibility of a scratch built solution against a ready made one. In this case, this class does much more than is necessary without being bloated and complicated. Honestly, give it a try – you really wont be disappointed.

  4. I found a LOT of code snippets that were outdated, error-prone, insecure and really not even fit for a tutorial.

    You’re right, unless you need something highly customized and specialized then using plugins/classes/modules either out of the box or modified is definitely the way to go.

    This class seems pretty good as well, maybe you could write a small tutorial on how to get started using it?

Leave a Comment

Your email address will not be published. Required fields are marked *