Skip to content

Commit 959c06d

Browse files
committed
minor #17334 [Mailer] docs: Add the mime type in the example (jorisros)
This PR was submitted for the 6.2 branch but it was merged into the 4.4 branch instead. Discussion ---------- [Mailer] docs: Add the mime type in the example While embedding images the examples don't have a mimetype. Some email clients will not show a image because of missing that mimetype. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- 3b08979 docs: Add the mime type in the example
2 parents 4fbc71f + 3b08979 commit 959c06d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mailer.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,9 @@ file or stream::
390390
$email = (new Email())
391391
// ...
392392
// get the image contents from a PHP resource
393-
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo')
393+
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo', 'image/png')
394394
// get the image contents from an existing file
395-
->embedFromPath('/path/to/images/signature.gif', 'footer-signature')
395+
->embedFromPath('/path/to/images/signature.gif', 'footer-signature', 'image/gif')
396396
;
397397

398398
The second optional argument of both methods is the image name ("Content-ID" in
@@ -401,8 +401,9 @@ images inside the HTML contents::
401401

402402
$email = (new Email())
403403
// ...
404-
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo')
405-
->embedFromPath('/path/to/images/signature.gif', 'footer-signature')
404+
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo', 'image/png')
405+
->embedFromPath('/path/to/images/signature.gif', 'footer-signature', 'image/gif')
406+
406407
// reference images using the syntax 'cid:' + "image embed name"
407408
->html('<img src="cid:logo"> ... <img src="cid:footer-signature"> ...')
408409
;

0 commit comments

Comments
 (0)