Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.3
-
Windows7, Jdk 1.7
Description
I'm having a html template for sending with 3 images.
If I resolve the images using DataSourceClassPathResolve, only the first is replaced. The 2 others have same cid and thus are replaced by the first.
Using others DataSource resolver leads to the good result.
Here is more details :
The template : <p>Une image en relatif <img src="testu/info.png"/></p><p>Une image en relatif <img src="testu/warning.png"/></p><p>Une image en relatif <img src="testu/error.png"/></p>
The code :
ImageHtmlEmail email = new ImageHtmlEmail();
email.setDataSourceResolver(new DataSourceClassPathResolver("/images/", true));
email.setHostName(...);
email.setCharset("utf-8");
email.addTo(...);
email.setFrom(...);
email.setSubject(...);
email.setHtmlMsg(corps /* ie the template above */);
email.setTextMsg("Your email client does not support HTML messages");
email.send();
The result (source of the received mail) :
<p>Une image en relatif <img src="cid:afgsltqedp"/></p><p>Une image en relatif <img src="cid:afgsltqedp"/></p><p>Une image en relatif <img src="cid:afgsltqedp"/></p>
You will notice that all cid are the same. The lenient flag is true so I'm sure that all images are present on classpath.