• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

inline image display in mail body

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a requirement to create a mailbox kind of thing, for that I need to poll specific inbox of email ids from mail server. I am doing these things using JavaMail. I need to show all mails as inbox type and user can reply/forward those also. I have generated an HTML page with contenteditable div where everything is coming. But inline images are not showing in mail body i.e. within contenteditable div. it's coming as separate attachment. In html source I am seeing that inline images are generally referred as cid:image001 type which is not being referred from my web application. Any idea how can I show those images within mail body? or where those cid:image... exactly exists? Because from outlook or Lotus Notes web mail also it is visible.

Regards
Soumya
 
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The images will be attachments on the email. The image001 in cid:image001 will be the value of the Content-Id attribute in the MIME headers for the attachment.
 
SoumyaGh Ghosh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rob for your reply.

What I am seeing is it's coming in the mail body as src="cid:image001". Is it the case that if Content_Id attribute of MIME header will be same of the src... then, image will be loaded inline? While reading from MailServer, doesn't any mail client store the image in any location? If not, how it will load the image? It would be great if you can please elaborate your view.
 
Sheriff
Posts: 28327
96
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I googled for a bit (keywords: javamail embedded images) and found for example this: http://javacoalface.blogspot.ca/2012/08/how-to-use-javamail-to-send-email-with.html

That isn't the only example those keywords returned, there were a lot more.
 
SoumyaGh Ghosh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Thanks for the reply. This example is for embedding inline image while sending a mail. It's setting a content-id in header and picked up the image from physical location like new File("./icon.jpg").
But I am facing problem during reading of a mail with inline image. Mail content is coming fine except the inline image part. "X" mark is coming at that image, that means it's not finding the image from the source mentioned in mail body. Please suggest ideas on it.

Regards
Soumya
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

SoumyaGh Ghosh wrote:But I am facing problem during reading of a mail with inline image. Mail content is coming fine except the inline image part. "X" mark is coming at that image, that means it's not finding the image from the source mentioned in mail body.


It could also mean that images are not loaded (which is the default for many web mailers). What tool are you using to read the mail?

Also be aware that there are people and/or mail clients out there that refuse to deal with HTML mail, so you'd do well to also provide a text-only mail that has the images as attachment if they're important.
 
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic