From 18006fb92dc88e25a83fea00c334a265cb10f922 Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Tue, 2 Aug 2022 23:24:47 +0200 Subject: [PATCH] [Mailer] Document the stop() method of SmtpTransport --- mailer.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mailer.rst b/mailer.rst index fd079e260c3..e83c60e20c0 100644 --- a/mailer.rst +++ b/mailer.rst @@ -1240,6 +1240,19 @@ disable asynchronous delivery. ->messageBus('app.another_bus'); }; +.. note:: + + In cases of long-running scripts, and when Mailer uses the + :class:`Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport` + you may manually disconnect from the SMTP server to avoid keeping + an open connection to the SMTP server in between sending emails. + You can do so by using the ``stop()`` method. + +.. versionadded:: 6.1 + + The :method:`Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport::stop()` + method was made public in Symfony 6.1. + Adding Tags and Metadata to Emails ----------------------------------