• Post Reply Bookmark Topic Watch Topic
  • New Topic

Embedding image to the email sent through JavaMail  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

The code below attaches the gif to the email.
does anyone know how to embed it?


MimeBodyPart mbp2 = new MimeBodyPart();
FileDataSource fds = new FileDataSource("TheFuture.gif");
mbp2.setFileName(fds.getName());
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setHeader("Content-ID","<23abc@pc27>");
mp.addBodyPart(mbp2);

msg.setContent(mp);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!