Skip to content

Commit 3b08979

Browse files
jorisrosjaviereguiluz
authored andcommitted
docs: Add the mime type in the example
While embedding images the examples don't have a mimetype. Some email clients will not work while missing that mimetype.
1 parent 4fbc71f commit 3b08979

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)