How to docx includes image, how work into node send mail

However, when I pass this HTML into a Gmail node in n8n to send an email, the images are not displayed in the email content — the area where the image should be is just empty.

:magnifying_glass_tilted_left: I understand the issue is that the image source (media/image1.png) is a local file path, so email clients can’t access it.

:white_check_mark: How can I modify or prepare the HTML so that images from the .docx file show properly when sending an email via n8n Gmail node?
For example: Should I embed the image as base64 inside the HTML, or is there another recommended approach?


If the pandoc command in “Execute command” node is producing images, you need to read these images and then attach them after running the command. When embedding, you can embed as base64 src (1), or attach as files and then use cid:(2) with a pointer to the attached binary.

<img src="data:<mime-type>;base64, <base64 string>" alt="Red dot" />
<img src="cid:image_1">

1- You can use inline Base64. Convert the image to Base64 and use:

<img src="data:<mime-type>;base64,<base64-string>" alt="..." />

This way, the image travels within the HTML and is displayed directly. However, if there are many images or they are large, the email can become bulky.

2 Likes

The Base64 encoding is too large, which prevents the image from being displayed in Gmail because of its size restrictions.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.