diff --git a/mailer.rst b/mailer.rst index 07f341cf508..cf17a55a6e2 100644 --- a/mailer.rst +++ b/mailer.rst @@ -347,6 +347,30 @@ may be specified as SHA1 or MD5 hash:: $dsn = 'smtp://user:pass@smtp.example.com?peer_fingerprint=6A1CF3B08D175A284C30BC10DE19162307C7286E'; +Disabling automatic TLS +~~~~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 7.1 + + Disabling automatic TLS was introduced in Symfony 7.1. + +By default, mailer will check if OpenSSL extension is enabled and if SMTP server +is capable of STARTTLS, it will issue this command to enable encryption on stream. +This behavior can be turned off by calling ``setAutoTls(false)`` on ``EsmtpTransport`` +instance, or by setting ``auto_tls`` option in DSN:: + + $dsn = 'smtp://user:pass@10.0.0.25?auto_tls=false'; + +.. caution:: + + It's not recommended to disable TLS while connecting to SMTP server over + internet, but it can be useful when both application and SMTP server are in + secured network, where there is no need for additional encryption. + +.. note:: + + This setting works only when ``smtp://`` protocol is used. + Overriding default SMTP authenticators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~