Skip to content

Commit e8a62c7

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: [Mailer] Document how to set headers
2 parents 12fda02 + 00fe859 commit e8a62c7

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
@@ -184,6 +184,23 @@ Alternatively, you can pass multiple addresses to each method::
184184
// ...
185185
;
186186

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

0 commit comments

Comments
 (0)