Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 9th, 2012  |  syntax: None  |  size: 0.44 KB  |  hits: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. javamail mail image located on remote machine
  2. BodyPart imagen = new MimeBodyPart();
  3.  
  4. DataSource ds=new FileDataSource("c:/image.gif");
  5. image.setDataHandler(new DataHandler(ds));
  6.  
  7. image.setHeader("Content-ID","img");
  8.        
  9. BodyPart imagen = new MimeBodyPart();
  10.  
  11. URL url = new URL("http://server.com/mybestpicture.jpg");
  12. URLDataSource ds = new URLDataSource(url);
  13. image.setDataHandler(new DataHandler(ds));
  14.  
  15. image.setHeader("Content-ID", "img");