Skip to content

Commit ead19d0

Browse files
committed
[Mailer][Smtp] Document 'auto_tls' param
1 parent 8d5a3bc commit ead19d0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

mailer.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,30 @@ may be specified as SHA1 or MD5 hash::
347347

348348
$dsn = 'smtp://user:[email protected]?peer_fingerprint=6A1CF3B08D175A284C30BC10DE19162307C7286E';
349349

350+
Disabling automatic TLS
351+
~~~~~~~~~~~~~~~~~~~~~~~
352+
353+
.. versionadded:: 7.1
354+
355+
Disabling automatic TLS was introduced in Symfony 7.1.
356+
357+
By default, mailer will check if OpenSSL extension is enabled and if SMTP server
358+
is capable of STARTTLS, it will issue this command to enable encryption on stream.
359+
This behavior can be turned off by calling ``setAutoTls(false)`` on ``EsmtpTransport``
360+
instance, or by setting ``auto_tls`` option in DSN::
361+
362+
$dsn = 'smtp://user:[email protected]?auto_tls=false';
363+
364+
.. caution::
365+
366+
It's not recommended to disable TLS while connecting to SMTP server over
367+
internet, but it can be useful when both application and SMTP server are in
368+
secured network, where there is no need for additional encryption.
369+
370+
.. note::
371+
372+
This setting works only when ``smtp://`` protocol is used.
373+
350374
Overriding default SMTP authenticators
351375
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
352376

0 commit comments

Comments
 (0)