[Mailer] Add supported auth modes to exception

If there is no match for the available authenticators the thrown
exception now includes the supported auth methods as reported by the server.
This commit is contained in:
Markus Klein 2021-03-16 13:51:16 +01:00
parent 7cc5cef1c3
commit d9c99d86ab

View File

@ -178,7 +178,7 @@ class EsmtpTransport extends SmtpTransport
}
if (!$authNames) {
throw new TransportException('Failed to find an authenticator supported by the SMTP server.');
throw new TransportException('Failed to find an authenticator supported by the SMTP server, which currently supports: '.implode(', ', $modes));
}
$message = sprintf('Failed to authenticate on SMTP server with username "%s" using the following authenticators: "%s".', $this->username, implode('", "', $authNames));