在 clojure postal 的 html 中嵌入图像不适用于 Gmail 或 macOS 邮件

问题描述 投票:0回答:1

我正在使用 postal 发送电子邮件,正文如下:

:body [
{:type "text/html;charset=utf-8;"
                :content "<div> <img src=\"cid:file.png\" alt=\"filename\" Your Order has been received\"> <div>"
                }
{:type :attachment
                :content (java.io.File. "/path/to/file.png")}
]

我的目标是将附加的 file.png 作为图像加载到 html 中。但是,即使正在发送附件,图像也不会加载到 html 中,至少在 gmail 和 macOS 邮件上是这样。对于 cid,我尝试了完整路径和文件名,但都不起作用。我该如何解决这个问题?

html clojure
1个回答
0
投票

添加

content-id file
,然后是这个
src=\"cid:file\"

© www.soinside.com 2019 - 2024. All rights reserved.