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 ofself
, so it's possible to override static internal functions in subclasses, for examplevalidateAddress()
- 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 usestatic::$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 withVERSION
constant)PHPMailer->ReturnPath
PHPMailer->PluginDir
PHPMailer->encodeQPphp()
SMTP->CRLF
(replaced withLE
constant)SMTP->Version
(replaced withVERSION
constant)SMTP->SMTP_PORT
(replaced withDEFAULT_PORT
constant)POP3->CRLF
(replaced withLE
constant)POP3->Version
(replaced withVERSION
constant)POP3->POP3_PORT
(replaced withDEFAULT_PORT
constant)POP3->POP3_TIMEOUT
(replaced withDEFAULT_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 fromparseAddresses()
- ๐
idnSupported()
is now static and is called statically frompunyencodeAddress()
PHPMailer->SingleToArray
is now protected- ๐
fixEOL()
method removed - it duplicatesPHPMailer::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 overridegetSMTPInstance()
. - ๐ Make obtaining SMTP transaction ID more reliable
- ๐ Better handling of unreliable PHP timeouts
- Made
SMTPDebug = 4
slightly less noisy