commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fausto Lelli" <f.le...@inera.it>
Subject Fw: problem commons-email html embedded img
Date Fri, 24 Nov 2006 10:15:48 GMT
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