Images ( referenced with cid ) don't display in the HTML mail
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Martins_Elisabeth
Posted On:   Tuesday, October 9, 2001 03:52 AM

I need to send an HTML message with images included. So I follow the instructions given in the tutorial and create a "multipart/related" message. Here's a portion of my code : .... msgText=" ... img src=cid:abcdabcd> ..."; MimeMultipart mp = new MimeMultipart("related"); BodyPart mbp = new MimeBodyPart(); mbp.setContent(msgText,"text/html"); mp.addBodyPart(mbp); mbp = new MimeBodyPart(); DataSource fds = new FileDataSource("c:/_dev/25a.gif"); mbp.setFileName(fds.getName()); mbp.setDataHandler(new DataHandler(fds)); mbp.setHeader("Content-ID","abcdabcd");   More>>

I need to send an HTML message with images included.
So I follow the instructions given in the tutorial and create a "multipart/related" message.


Here's a portion of my code :

			
....

msgText=" ... img src=cid:abcdabcd> ...";
MimeMultipart mp = new MimeMultipart("related");
BodyPart mbp = new MimeBodyPart();
mbp.setContent(msgText,"text/html");
mp.addBodyPart(mbp);

mbp = new MimeBodyPart();
DataSource fds = new FileDataSource("c:/_dev/25a.gif");
mbp.setFileName(fds.getName());
mbp.setDataHandler(new DataHandler(fds));
mbp.setHeader("Content-ID","abcdabcd");
mp.addBodyPart(mbp);

msg.setContent(mp);

Transport.send(msg);

Doing this, I'm not able to see the image in ifrance mail, but with hotmail it's OK.
Is there a way to have the images displayed everywhere ?


Thanks in advance for any response. It's urgent!.

   <<Less
About | Sitemap | Contact