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
  • 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
stackato and cloud 4 64
rhino JavaScript import, load 25 66
Show banners that are blocked by Ad Muncher 10 43
java stored proc example 9 18
We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now