Skip to content

Commit 00fe859

Browse files
committed
minor #13717 [Mailer] Document how to set headers (javiereguiluz)
This PR was merged into the 4.4 branch. Discussion ---------- [Mailer] Document how to set headers This fixes #13399 partially. We document headers in 4.4 version ... and after this is merged, we can document the tags/metadata introduced in 5.1 version. Commits ------- f603a98 [Mailer] Document how to set headers
2 parents f23ce24 + f603a98 commit 00fe859

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

mailer.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,23 @@ Alternatively, you can pass multiple addresses to each method::
186186
// ...
187187
;
188188

189+
Message Headers
190+
~~~~~~~~~~~~~~~
191+
192+
Messages include a number of header fields to describe their contents. Symfony
193+
sets all the required headers automatically, but you can set your own headers
194+
too. There are different types of headers (Id header, Mailbox header, Date
195+
header, etc.) but most of the times you'll set text headers::
196+
197+
$email = (new Email())
198+
->getHeaders()
199+
// this header tells auto-repliers ("email holiday mode") to not
200+
// reply to this message because it's an automated email
201+
->addTextHeader('X-Auto-Response-Suppress', 'OOF, DR, RN, NRN, AutoReply');
202+
203+
// ...
204+
;
205+
189206
Message Contents
190207
~~~~~~~~~~~~~~~~
191208

0 commit comments

Comments
 (0)