Skip to content

Commit ac0ea0c

Browse files
committed
Tweaks
1 parent 537c441 commit ac0ea0c

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

mailer.rst

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,24 +290,31 @@ Overriding default SMTP authenticators
290290
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291291

292292
By default, SMTP transports will try to login using all authentication methods
293-
available on the SMTP server, one after the other. In some cases, it may be useful
294-
to redefine the supported authentication methods to ensure that the preferred method
295-
will be used first.
296-
This can be done from ``EsmtpTransport`` constructor or using the ``setAuthenticators()`` method::
293+
available on the SMTP server, one after the other. In some cases, it may be
294+
useful to redefine the supported authentication methods to ensure that the
295+
preferred method will be used first.
296+
297+
This can be done from ``EsmtpTransport`` constructor or using the
298+
``setAuthenticators()`` method::
297299

298300
use Symfony\Component\Mailer\Transport\Smtp\Auth\XOAuth2Authenticator;
299301
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
300302

303+
// Choose one of these two options:
304+
305+
// Option 1: pass the authenticators to the constructor
301306
$transport = new EsmtpTransport(
302307
host: 'oauth-smtp.domain.tld',
303308
authenticators: [new XOAuth2Authenticator()]
304309
);
310+
311+
// Option 2: call a method to redefine the authenticators
305312
$transport->setAuthenticators([new XOAuth2Authenticator()]);
306313

307-
.. versionadded:: 6.3
314+
.. versionadded:: 6.3
308315

309-
The ``$authenticators`` constructor parameter and the ``setAuthenticators()`` method
310-
were introduced in Symfony 6.3.
316+
The ``$authenticators`` constructor parameter and the ``setAuthenticators()``
317+
method were introduced in Symfony 6.3.
311318

312319
Other Options
313320
~~~~~~~~~~~~~

0 commit comments

Comments
 (0)