Daniel O.
Daniel O.

Reputation: 175

Is it possible to get e-mail source using JavaMail?

I use JavaMail API to download mails via IMAP. I want to save them locally, in files. I have a DB, but I only want to store some meta-data in it (like mail file location).

Is there a possibility, using the JavaMail API, to get the actual source of an e-mail? Like in Outlook via context menu on a mail in a list and 'View Source'.

Thanks, Daniel

Upvotes: 1

Views: 504

Answers (1)

Daniel O.
Daniel O.

Reputation: 175

After some more API reading I've found a solution.

javax.mail.Part#writeTo(OutputStream)

does the thing.

Upvotes: 3

Related Questions