commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fausto Lelli" <f.le...@inera.it>
Subject Re: problem commons-email html embedded img
Date Fri, 24 Nov 2006 10:38:53 GMT
Sorry, I meant 

The email got sent but I *CANNOT*  see the embedded image within the email using 

Thunderbird or Evolution as .....

F.
  ----- Original Message ----- 
  From: Fausto Lelli 
  To: commons-user@jakarta.apache.org 
  Cc: Fausto Lelli 
  Sent: Friday, November 24, 2006 11:15 AM
  Subject: Fw: problem commons-email html embedded img


  Hi,

  I'm using Commons-Email and trying to send an HTML email with an embedded image.

  The email got sent but I can see the embedded image within the email using 

  Thunderbird or Evolution as an email client, instead I can only see the image as an 

  attached  file.  Outlook Express is showing the picture fine tough.

  I'm doing the test with the sample code in  the commons-email docs.

// Create the email message
HtmlEmail email = new HtmlEmail();
email.setHostName("mail.inera.it");
email.addTo("f.lelli@inera.it", "Me");
email.setFrom("f.lelli@inera.it", "Me");
email.setSubject("Test email with inline image");

// embed the image and get the content id
URL url = new URL("file:///C:/03.jpg");
String cid = email.embed(url, "Apache logo");

// set the html message
email.setHtmlMsg("<html>The apache logo - <img src=\"cid:"+cid+"\"></html>");

// set the alternative message
email.setTextMsg("Your email client does not support HTML messages");

// send the email
email.send();
  My Environment:

  Commons Email 1.0
  Thunderbird 1.5.0.8 (20061025)
  Evolution 
  Outlook Express 6.00.29

  java 5.0_08

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message