PHPMailer v6.0 Release Notes

Release Date: 2017-08-28 // over 6 years ago
  • โšก๏ธ This is a major update that breaks backwards compatibility.

    • Requires PHP 5.5 or later
    • ๐Ÿ‘‰ Uses the PHPMailer\PHPMailer namespace
    • File structure simplified and PSR-4 compatible, classes live in the src/ folder
    • ๐Ÿ‘‰ The custom autoloader has been removed: use composer!
    • Classes & Exceptions renamed to make use of the namespace
    • Most statically called functions now use the static keyword instead of self, so it's possible to override static internal functions in subclasses, for example validateAddress()
    • 0๏ธโƒฃ Complete RFC standardisation on CRLF (\r\n) line breaks for SMTP by default:
      • PHPMailer:$LE defaults to CRLF
      • All uses of PHPMailer::$LE property converted to use static::$LE constant for consistency and ease of overriding
      • Similar changes to line break handling in SMTP and POP3 classes.
      • Line break format for mail() transport is set automatically.
      • Warnings emitted for buggy mail() in PHP versions 7.0.0 - 7.0.16 and 7.1.0 - 7.1.2; either upgrade or switch to SMTP.
    • ๐Ÿ‘ Extensive reworking of XOAUTH2, adding support for Google, Yahoo and Microsoft providers, thanks to @sherryl4george
    • ๐Ÿ“„ Major cleanup of docs and examples
    • ๐Ÿšš All elements previously marked as deprecated have been removed:
      • PHPMailer->Version (replaced with VERSION constant)
      • PHPMailer->ReturnPath
      • PHPMailer->PluginDir
      • PHPMailer->encodeQPphp()
      • SMTP->CRLF (replaced with LE constant)
      • SMTP->Version (replaced with VERSION constant)
      • SMTP->SMTP_PORT (replaced with DEFAULT_PORT constant)
      • POP3->CRLF (replaced with LE constant)
      • POP3->Version (replaced with VERSION constant)
      • POP3->POP3_PORT (replaced with DEFAULT_PORT constant)
      • POP3->POP3_TIMEOUT (replaced with DEFAULT_TIMEOUT constant)
    • ๐Ÿšš NTLM authentication has been removed - it never worked anyway!
      • PHPMailer->Workstation
      • PHPMailer->Realm
    • ๐Ÿ—„ SingleTo functionality is deprecated; this belongs at a higher level - PHPMailer is not a mailing list system.
    • SMTP::authenticate method signature changed
    • ๐Ÿ“œ parseAddresses() is now static
    • ๐Ÿ“œ validateAddress() is now called statically from parseAddresses()
    • ๐Ÿ‘ idnSupported() is now static and is called statically from punyencodeAddress()
    • PHPMailer->SingleToArray is now protected
    • ๐Ÿšš fixEOL() method removed - it duplicates PHPMailer::normalizeBreaks(), so use that instead
    • ๐Ÿ‘ Don't try to use an auth mechanism if it's not supported by the server
    • Reorder automatic AUTH mechanism selector to try most secure method first
    • ๐Ÿ“ฆ Extras classes have been removed - use alternative packages from packagist.org instead
    • ๐Ÿ‘ Better handling of automatic transfer encoding switch in the presence of long lines
    • Simplification of address validation - now uses PHP's FILTER_VALIDATE_EMAIL pattern by default, retains advanced options
    • Debugoutput can accept a PSR-3 logger instance
    • ๐Ÿš€ To reduce code footprint, the examples folder is no longer included in composer deployments or github zip files
    • Trap low-level errors in SMTP, reports via debug output
    • More reliable folding of message headers
    • Inject your own SMTP implementation via setSMTPInstance() instead of having to subclass and override getSMTPInstance().
    • ๐Ÿ‘‰ Make obtaining SMTP transaction ID more reliable
    • ๐Ÿ‘ Better handling of unreliable PHP timeouts
    • Made SMTPDebug = 4 slightly less noisy