【问题标题】:Send email with images using JHipster and Thymeleaf使用 JHipster 和 Thymeleaf 发送带有图像的电子邮件
【发布时间】:2018-01-07 07:17:12
【问题描述】:

我正在尝试在我的 JHipster 项目中使用图像,但 Thymeleaf 无法识别我的 JHipster 项目中图像的位置。

我的图片位于此文件夹:*C:\PATH\src\main\webapp\content\img_email* 和我的 HTML 模板位于:*C:\PATH\src\main\resources\mails*。

我尝试了以下组合,例如 src="../../content/img_email/logo-5asec.jpg" 甚至尝试使用符号 th:src=" @{~/PATH/img_email/logo-5asec.jpg}"。我什至尝试更改图像文件夹位置但没有成功。

【问题讨论】:

    标签: java spring-boot thymeleaf jhipster


    【解决方案1】:

    您必须在电子邮件消息中为您的图像使用完整的 URL(例如http://my.domain.org/content/images/something.png),否则邮件客户端不知道从哪里下载它们。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-27
      • 2017-08-03
      • 2015-07-29
      • 2013-11-11
      • 2012-04-07
      相关资源
      最近更新 更多