The Next Generation

Need volunteers! If you are looking to participate in the Open Source community, PHPMailer2 may be the project for you. Send an email indicating your interest. andy@codeworxtech.com
We are looking for contributors: Unit testing, documentation, testing, support, and - of course - programmers.

One of the tasks of a developer is to make their software easy to use. Not just easy, simple. Simple to configure, simple to implement, simple to support. If you are going to invest your time incorporating software in your own project, get software that respects your efforts and your time. PHPMailer2 is that package.

Full Featured Email Transfer Class for PHP. PHPMailer2 features:

  • 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
  • Note: SMTP is no longer a separate class, it is built into PHPMailer2 as an the first transport. Order of rotation is SMTP, sendmail, followed by mail().

PHPMailer2 is a complete reboot. A major re-write. With this reboot, much of the functionality is updated and automated. Here’s some examples:

  • All of the email addresses are now RFC2822 compliant
  • You can specify Sender, Recipient, CC, and BCC as flexible arrays (or a string):
    [ "Name" => "name@domain.com" ]
    [ "name@domain.com" => "Name" ]
    [ "name@domain.com" ]
    ... even a combination of the different array styles:
    [ "Name" => "name@domain.com", "othername@domain.com" => "Other Name" ]
    ... and for ultimate flexibility - even a string:
    "name@domain.com, othername@domain.com"
    ... and for even more "ultimate" flexibility - even the old style:
    ["name@domain.com","Your Name"]
  • PHPMailer2 supports mail() mainly for Windows servers that do not have "sendmail" compatibility. PHP mail() is a wrapper for sendmail – not even a very good wrapper. Since mail() is a wrapper for sendmail, we now bypass mail() and go to sendmail directly.
  • As a late last minute addition, sendmail is now the second priority for sending. If we can locate an MX record for your domain, we will use SMTP with no authentication to send the email. On a failure, the next transport in the rotation is sendmail, followed by mail().
  • No need to specify a path to sendmail ... PHPMailer2 detects automatically
  • IsSendmail, IsMail, IsQmail, are deprecated and deleted. IsSMTP is deprecated and will be deleted in an upcoming release.
  • To use SMTP, simply setup the SMTP Host, SMTP Username and SMTP Password.
  • No need to specify 'tls', 'ssl' or a port. PHPMailer2 also adds an 'auto' socket option and will determine the correct socket protocol and port. You can override.