From 3b08979d1c460a93ce3232cd57bd21255ea1366b Mon Sep 17 00:00:00 2001 From: Joris Ros Date: Fri, 7 Oct 2022 18:24:44 +0200 Subject: [PATCH] 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. --- mailer.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mailer.rst b/mailer.rst index d03bbef5a33..32303f97aac 100644 --- a/mailer.rst +++ b/mailer.rst @@ -390,9 +390,9 @@ file or stream:: $email = (new Email()) // ... // get the image contents from a PHP resource - ->embed(fopen('/path/to/images/logo.png', 'r'), 'logo') + ->embed(fopen('/path/to/images/logo.png', 'r'), 'logo', 'image/png') // get the image contents from an existing file - ->embedFromPath('/path/to/images/signature.gif', 'footer-signature') + ->embedFromPath('/path/to/images/signature.gif', 'footer-signature', 'image/gif') ; The second optional argument of both methods is the image name ("Content-ID" in @@ -401,8 +401,9 @@ images inside the HTML contents:: $email = (new Email()) // ... - ->embed(fopen('/path/to/images/logo.png', 'r'), 'logo') - ->embedFromPath('/path/to/images/signature.gif', 'footer-signature') + ->embed(fopen('/path/to/images/logo.png', 'r'), 'logo', 'image/png') + ->embedFromPath('/path/to/images/signature.gif', 'footer-signature', 'image/gif') + // reference images using the syntax 'cid:' + "image embed name" ->html(' ... ...') ;