File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -629,8 +629,8 @@ file or stream::
629
629
Use the ``asInline() `` method to embed the content instead of attaching it.
630
630
631
631
The second optional argument of both methods is the image name ("Content-ID" in
632
- the MIME standard). Its value is an arbitrary string used later to reference the
633
- images inside the HTML contents::
632
+ the MIME standard). Its value is an arbitrary string that must be unique in each
633
+ email message and is used later to reference the images inside the HTML contents::
634
634
635
635
$email = (new Email())
636
636
// ...
@@ -644,16 +644,18 @@ images inside the HTML contents::
644
644
->html('... <div background="cid:footer-signature"> ... </div> ...')
645
645
;
646
646
647
+ The actual Content-ID value present in the e-mail source will be randomly generated by Symfony.
647
648
You can also use the :method: `DataPart::setContentId() <Symfony\\ Component\\ Mime\\ Part\\ DataPart::setContentId> `
648
649
method to define a custom Content-ID for the image and use it as its ``cid `` reference::
649
650
650
651
$part = new DataPart(new File('/path/to/images/signature.gif'));
651
- $part->setContentId('footer-signature');
652
+ // according to the spec, the Content-ID value must include at least one '@' character
653
+ $part->setContentId('footer-signature@my-app');
652
654
653
655
$email = (new Email())
654
656
// ...
655
657
->addPart($part->asInline())
656
- ->html('... <img src="cid:footer-signature"> ...')
658
+ ->html('... <img src="cid:footer-signature@my-app "> ...')
657
659
;
658
660
659
661
.. _mailer-configure-email-globally :
You can’t perform that action at this time.
0 commit comments