Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mantis 19845 - support phpmailer 5 and 6 #608

merged 2 commits into from Nov 5, 2019


Copy link

bramley commented Nov 3, 2019


Changes to the PHPlistMailer class to use either PHPMailer version 5 or version 6 depending on a config setting.

The important changes to use PHPMailer 6 are the use of namespaces, which makes it backwards-incompatible, and PHPMailer now requiring php 5.5 or later.

Added PHPMailer 6 in the directory admin/PHPMailer6
Added an intermediate class to encapsulate the code specific to each PHPMailer version.
Added a property $lineEnding which is set to "\n" for the current PHPMailer and to the new static $LE for PHPMailer 6.
Changed all occurrences of $this->LE to $this->lineEnding except in amazonSesSend() which is changed to remove trailing white space, as phpmailer itself does.

Tidied-up the visibility of class properties, clarified those which are additional as opposed to inherited, and removed some that appear to be unused.

Removed some obsolete code that supported earlier versions of phpmailer

  • add_attachment()
  • add_html_image()

I have tested

  • sending using quoted-printable encoding
  • sending using 8bit encoding
  • adding an attachment
  • embedding images
  • sending through an smtp server
  • sending using the Amazon SES API
  • sending through a plugin

Related Issue

Screenshots (if appropriate):


This comment has been minimized.

Copy link

michield commented Nov 3, 2019

That's brilliant. @suelaP we can merge this in and get it out to the world, and then it can be enabled with a switch. Once that has been done, that makes it much easier to test it in individual systems and then we can review.

@suelaP suelaP merged commit 495217f into phpList:master Nov 5, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
@bramley bramley deleted the bramley:Mantis_19845_phpmailer5and6 branch Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.