diff --git a/mailer.rst b/mailer.rst index c546d64dc2c..203d110ae51 100644 --- a/mailer.rst +++ b/mailer.rst @@ -256,6 +256,23 @@ images inside the HTML contents:: ->html(' ... ...') ; +Debugging Emails +---------------- + +The :class:`Symfony\\Component\\Mailer\\SentMessage` object returned by the +``send()`` method of the :class:`Symfony\\Component\\Mailer\\Transport\\TransportInterface` +provides access to the original message (``getOriginalMessage()``) and to some +debug information (``getDebug()``) such as the HTTP calls done by the HTTP +transports, which is useful to debug errors. + +The exceptions related to mailer transports (those which implement +:class:`Symfony\\Component\\Mailer\\Exception\\TransportException`) also provide +this debug information via the ``getDebug()`` method. + +.. versionadded:: 4.4 + + The ``getDebug()`` methods were introduced in Symfony 4.4. + .. _mailer-twig: Twig: HTML & CSS