html - Thymeleaf 电子邮件图像未显示
问题描述
我将 Thymeleaf 与 Spring Boot 一起使用。
我正在尝试使用 html 模板发送邮件。
邮件没问题,模板中的变量thymeleaf被替换它是完美的,但是,我唯一的问题是图像不显示。就像图像不存在一样。
html 模板和图像 ( Picture.png ) 在同一个文件夹中。
在模板中,我尝试了这些倍数:
<img src="Picture.png" />
<img src="@{Picture.png}" />
<img th:src="|cid:${imageName}|" /> // by passing the "Picture.png" in the imageName variable
<img th:src="@{Picture.png}" />
但没有任何工作,我需要帮助谢谢!
解决方案
我回答了我自己的问题,因为我成功解决了这个问题:
就这样放在<img src="cid:imageName"/>
html文件中
推荐阅读
- c# - 如何在图像上绘制并保存在 UWP 中?
- c# - WPF在失去焦点时删除列表视图突出显示的背景
- java - 如何使用 Mockito @InjectMocks 将 HttpServletRequest 注入到 ContainerRequestFilter
- python - 我的 Django 项目在 PyCharm 上没有运行调试
- python - 在 Python 中打印字符串 (TestDome)
- classloader - 未使用的从 Java 1.8 导入 lib 并使用 Java 1.7 运行
- java - 泛型中的 List 和 ArrayList 特殊行为
- go - Golang requestId 日志记录
- .htaccess - Codeigniter 删除 index.php 不起作用
- postgresql - 将 postgres 表主键 UUID 更改为 Character Varying