Skip to content

Commit

Permalink
[Mailer] Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Jun 10, 2024
1 parent 90140b4 commit 928e2ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mailer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,8 @@ file or stream::
Use the ``asInline()`` method to embed the content instead of attaching it.

The second optional argument of both methods is the image name ("Content-ID" in
the MIME standard). Its value is an arbitrary string used later to reference the
images inside the HTML contents::
the MIME standard). Its value is an arbitrary string that must be unique in each
email message and is used later to reference the images inside the HTML contents::

$email = (new Email())
// ...
Expand All @@ -683,11 +683,11 @@ images inside the HTML contents::
;

The actual Content-ID value present in the e-mail source will be randomly generated by Symfony.

You can also use the :method:`DataPart::setContentId() <Symfony\\Component\\Mime\\Part\\DataPart::setContentId>`
method to define a custom Content-ID for the image and use it as its ``cid`` reference::

$part = new DataPart(new File('/path/to/images/signature.gif'));
// according to the spec, the Content-ID value must include at least one '@' character
$part->setContentId('footer-signature@my-app');

$email = (new Email())
Expand Down

0 comments on commit 928e2ce

Please sign in to comment.