minor #40488 [Mailer] Add supported auth modes to exception (liayn)

This PR was merged into the 5.3-dev branch.

Discussion
----------

[Mailer] Add supported auth modes to exception

| Q             | A
| ------------- | ---
| Branch?       | 4.4+
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

If there is no match for the available authenticators the thrown exception now includes the supported auth methods as reported by the server.

Commits
-------

d9c99d86ab [Mailer] Add supported auth modes to exception
This commit is contained in:
Fabien Potencier 2021-03-17 07:21:46 +01:00
commit 9287099c57

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));