From f603a98298d253848052066e1a555f2464c75157 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 28 May 2020 15:37:28 +0200 Subject: [PATCH] [Mailer] Document how to set headers --- mailer.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mailer.rst b/mailer.rst index 2e3d7a1c881..be19e495751 100644 --- a/mailer.rst +++ b/mailer.rst @@ -186,6 +186,23 @@ Alternatively, you can pass multiple addresses to each method:: // ... ; +Message Headers +~~~~~~~~~~~~~~~ + +Messages include a number of header fields to describe their contents. Symfony +sets all the required headers automatically, but you can set your own headers +too. There are different types of headers (Id header, Mailbox header, Date +header, etc.) but most of the times you'll set text headers:: + + $email = (new Email()) + ->getHeaders() + // this header tells auto-repliers ("email holiday mode") to not + // reply to this message because it's an automated email + ->addTextHeader('X-Auto-Response-Suppress', 'OOF, DR, RN, NRN, AutoReply'); + + // ... + ; + Message Contents ~~~~~~~~~~~~~~~~