PHP API收到的Gmail电子邮件未显示嵌入的图片

I am receiving HTML emails with embedded images and the images display as expected in GMail. However in my html can't found image

following screenshot shows broken image in mail body and in inspect element it is

<img src="cid:image002.png@01D1BDB3.A9B852C0" v:shapes="_x0000_i1025" height="1227" width="1168">

Content-type : multipart/related.

enter image description here

Like you state yourself, you are receiving a multipart/related mime type, but it looks like you're only looking at the text/html part.

A multipart/related mime type means there are at least 2 parts (each with it's own mime type), so apart from the text/html, there's probably a image/* mime type part.

In the case of embedded images, the Gmail API sends it in these different parts. As you can see in your case, the html part has a reference to the embedded image cid:image002.png@01D1BDB3.A9B852C0, this is the Content-ID value of the image/* mime type part.

So you would have to read the image/* part to get its value and use it to replace the cid in the html.