Send email with images using JHipster and Thymelea

2019-08-22 12:08发布

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条回答
乱世女痞
2楼-- · 2019-08-22 12:47

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.

查看更多
登录 后发表回答