PHP - Embedded Images Not Displayed in Thunderbird

I want to send a PHP inbox with inline / inline images (aka cid). Mail successfully sent and received correctly in Gmail. However, in Thunderbird (latest version for windows), the inline / inline image is not displayed.

I followed the information provided in this one , but it still does not work. Therefore, the inline / inline image is displayed in Gmail, but not in Thunderbird. Does anyone know a problem here?

To: example@example.com Subject: Test From: noreply@test.com <noreply> MIME-Version: 1.0 Content-Type: multipart/related; boundary="52cd9ebf4fb8c9b0547e93b82b3f3f6b" --52cd9ebf4fb8c9b0547e93b82b3f3f6b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test mail</title> </head> <body> <img src="cid:myImage" alt="This is a embedded image" /> </body> </html> --52cd9ebf4fb8c9b0547e93b82b3f3f6b Content-Type: image/jpg; name="myImage.jpg" Content-Transfer-Encoding: base64 Content-ID: <myImage> Content-Disposition: inline; filename="myImage.jpg" [base64 encoded string goes here.] --52cd9ebf4fb8c9b0547e93b82b3f3f6b-- 
+5
source share
3 answers

Mm ... RFC 1521 says the Content-Type header format is similar to this

The formal grammar for the content header field for the text is as follows:

text-type: = "text" "/" text-subtype [";" "charset" "=" charset]

text-subtype: = "plain" / extension-token

charset: = "us-ascii" / "iso-8859-1" / "iso-8859-2" / "iso-8859-3" / "iso-8859-4" / "iso-8859-5" / " iso-8859-6 "/" iso-8859-7 "/" iso-8859-8 "/" iso-8859-9 "/ extension-token; case insensitive

I mean the content type and the following encoding. But you put

Content-Type: image / jpg; name = "myImage.jpg"

so ... it might break your image ... another sentence puts your content id in lower case and not on camel case

Regards Emiliano

+1
source

I would look at the right case on image extensions. In the past, I found that .jpg will be displayed in many browsers, even if the image file extension is .JPG ... but for some it will break or at least act inconsistently.

Perhaps this is not so, but it is worth taking a peak.

+1
source

Thanks to everyone for the answer. I'm not sure about this, but it seems that the thunderbird developers made a fix in their latest release because it now works. If this is correct, thanks to the Thunderbird developers!

0
source

Source: https://habr.com/ru/post/1259340/


All Articles