File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes JavaMail: MIMEMessages from E-mails on disk? 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 "JavaMail: MIMEMessages from E-mails on disk?" Watch "JavaMail: MIMEMessages from E-mails on disk?" New topic
Author

JavaMail: MIMEMessages from E-mails on disk?

Ed Beaty
Greenhorn

Joined: Apr 27, 2005
Posts: 6
Hello! I have folders of archived E-mails saved to disk that I need to sort through. I would like to use JavaMail to create MIMEMessages from the saved mails, then get at the headers, recipient, contents and so on. The problem is that I don't know how to create MIMEMessages from an InputStream without having a valid Session and/or Folder, and that appears to require the URL of a valid E-mail server. Is it possible to create a Session that represents a set of locally stored E-mails, and not a live mail server, which I could then use to create my MIMEMessages? Alternately, can anyone recommend a simple way of getting at the MIME information (including attachments) in my files?

As always, any help would be very greatly appreciated.
Thank you,
Ed Beaty
Ed Beaty
Greenhorn

Joined: Apr 27, 2005
Posts: 6
I did some searching, and found a possible solution. It appears to generate a "null session" which does not require a live E-mail server to read mails from an input stream:



Comments? Is there a better/safer/more efficient way to do this?
Thanks,
Ed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaMail: MIMEMessages from E-mails on disk?