Is there a way in JavaMail to get only messages that have an Attachment?

Posted on 2010-11-28
Last Modified: 2013-11-19
Hey I am new to JavaMail and have an issue that I only want to fetch emails that have an attachment. Is there a way to do that without having to download and parse the parts to all new messages? (for POP3 and IMAP)?
Question by:amirsky
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
LVL 86

Expert Comment

ID: 34225351

Author Comment

ID: 34225372
Interesting, but is having a type 'multipart/*' and a part count > 0 really a garuntee that there are FILE attachments? Couldn't there just be more than one INLINE text or such?
LVL 86

Expert Comment

ID: 34225374
Yes, that could easily be too naive. You might need to perform further tests
LVL 86

Accepted Solution

CEHJ earned 500 total points
ID: 34225384
LVL 86

Expert Comment

ID: 34225586

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question