diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.xml
index 17ed496661..7447445949 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_debug.xml
@@ -8,5 +8,10 @@
No emails were sent.
+{{ message.toString() }}+
{{ (message.headers.get('from').bodyAsString() ?? '(empty)')|replace({'From:': ''}) }}+ + To +
{{ (message.headers.get('to').bodyAsString() ?? '(empty)')|replace({'To:': ''}) }}+
{% for header in message.headers.all|filter(header => (header.name ?? '') not in ['Subject', 'From', 'To']) %} + {{- header.toString }} + {%~ endfor %}+
+ {%- if message.htmlCharset() %} + {{- message.htmlBody()|convert_encoding('UTF-8', message.htmlCharset()) }} + {%- else %} + {{- message.htmlBody() }} + {%- endif -%} ++
+ {%- if message.textCharset() %} + {{- message.textBody()|convert_encoding('UTF-8', message.textCharset()) }} + {%- else %} + {{- message.textBody() }} + {%- endif -%} ++
{{ attachment.toString() }}+
{{ message.body().asDebugString() }}+
{{ message.toString() }}+