Send email with images using JHipster and Thymeleaf

六眼飞鱼酱① 提交于 2019-12-25 00:53:25

问题


I'm trying to use images in my JHipster project, but Thymeleaf can't identify the location of the images in my JHipster project.

My images are located in this folder: *C:\PATH\src\main\webapp\content\img_email* and my HTML templates in: *C:\PATH\src\main\resources\mails*.

I tried following combinations such as src="../../content/img_email/logo-5asec.jpg" and even tried to use the notation th:src="@{~/PATH/img_email/logo-5asec.jpg}". I even tried to change the images folder location without success.


回答1:


You must use full URLs for your images (e.g.http://my.domain.org/content/images/something.png) in e-mail messages otherwise a mail client has no idea where to download them from.



来源:https://stackoverflow.com/questions/45420593/send-email-with-images-using-jhipster-and-thymeleaf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!