Skip to content

Commit 468a9ac

Browse files
committed
[Mailer] Fixed and clarified custom Content-ID feature documentation
1 parent 455402b commit 468a9ac

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mailer.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,16 +658,18 @@ images inside the HTML contents::
658658
->html('... <div background="cid:footer-signature"> ... </div> ...')
659659
;
660660

661+
The actual Content-ID value present in the e-mail source will be randomly generated by Symfony.
662+
661663
You can also use the :method:`DataPart::setContentId() <Symfony\\Component\\Mime\\Part\\DataPart::setContentId>`
662664
method to define a custom Content-ID for the image and use it as its ``cid`` reference::
663665

664666
$part = new DataPart(new File('/path/to/images/signature.gif'));
665-
$part->setContentId('footer-signature');
667+
$part->setContentId('footer-signature@my-app');
666668

667669
$email = (new Email())
668670
// ...
669671
->addPart($part->asInline())
670-
->html('... <img src="cid:footer-signature"> ...')
672+
->html('... <img src="cid:footer-signature@my-app"> ...')
671673
;
672674

673675
.. versionadded:: 6.1

0 commit comments

Comments
 (0)