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("[EMAIL PROTECTED]", "Me");
email.setFrom("[EMAIL PROTECTED]", "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