File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Java Mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java Mail" Watch "Java Mail" New topic

Java Mail

Dave Hewy
Ranch Hand

Joined: Aug 21, 2003
Posts: 93
Does anyone know of a utility class out there that just takes an object of type Message (or similar) and returns an object representing the email including the attachments etc?

Maybe it can do the opposite as well?

Seems like loads of people are writing code that is almost identical !

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Perhaps I am missunderstanding something, but a Message is an object representing the email. Perhaps you can explain what you are trying to do?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Dave Hewy
Ranch Hand

Joined: Aug 21, 2003
Posts: 93
Yeah - sorry, not made myself too clear.

You're right that it's a representation of an email, but you have to put a bit of work in to get all the bits out if you have file attachments, embedded attachments, pictures, embedded emails etc.

What would be good is an email object where all this has been done, so it may have methods that return a collection of all attachments for example, as byte arrays or similar.

Now I've had time to mess around with the classes, it's not that bad to have to do this yourself, but do you get what I mean?

I agree. Here's the link:
subject: Java Mail
It's not a secret anymore!