Quantcast
Channel: okmem.com - Latest entries
Viewing all articles
Browse latest Browse all 15

java 发邮件模板工具 以及mail 内图片关联

$
0
0

java chunk-templates mail

chunk-templates

不错的工具

http://www.x5software.com/chunk/examples/ChunkExample

对于template加图片的的需求,可以使用template引用附件图片的方法:

Example:

Template的修改

<h2>Detail Report</h2><IMG SRC="cid:John.png" ALT="test logo">

Java code修改

EmailAttachment attachment = new EmailAttachment();

attachment.setPath("e:/gnome-end_small.png");

attachment.setDisposition(EmailAttachment.ATTACHMENT);

attachment.setDescription("Picture of John");

attachment.setName("John.png");

email.attach(attachment);

 

关联方式

IMG SRC=cid:John.png

attachment.setName("John.png");

 

 

如果后期发现图片太大,可以考虑用外部link的方式。


Viewing all articles
Browse latest Browse all 15

Trending Articles