• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IMAP - javax.mail. - Fetching Only Body Without Attachment

 
Greenhorn
Posts: 6
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to develop an IMAP email client using the javax.mail API. I have been able to contact the servers, fetch emails, attachments and other operations without any problem.

However, we would not want to fetch the attachment until the user wants to view it explit in order to improve the performance. This would mean that we would need information which would indicate if the email has an attachment, if yes, then the filename(s) and the size(s)but would not send me the actual content of the email. However, I was not able to find a method in the API description which would return just the multi-part content.

Is there a way I could fetch just the body and the details of the attachment but not the actual attachment?

Thanks, Aravind
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Attachments are actually part of the entire email body.

An email exists out of two parts: the header and the body. This body can be a "regular" body (in plain text or HTML) but it can also be only an attachment (in base 64 encoding), or a combination of all of these. No client can fetch the email body without attachments because for the server, there is no such thing. The splitting of the body into a human readable form (plain text or HTML) and attachments can only be done when the client has the entire body, including attachments.
 
Grow your own food... or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic