Saving message to a file using Javamail.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Yogesh_Bhate
Posted On:   Monday, July 16, 2001 10:41 AM

Hi , What should i use to save a mail to a file on my hard disk. i have tried doing this.. --------------------------------- MimeMessage mime = new MimeMessage(session); FileOutputStream fos = new FileOutputStream("test.mail"); mime.writeTo(fos); ---------------------------------------- but it does not store the whole message..only the headers are saved... How to save the whole thing... Also if there are attachments i need to store those also.. Also how to read the message back from file thru Javamail. I could not find any specific answer for this problem in this list. Pls help. Tia. Yogesh.    More>>

Hi ,
What should i use to save a mail to a file on my hard disk.
i have tried doing this..
---------------------------------
MimeMessage mime = new MimeMessage(session);
FileOutputStream fos = new FileOutputStream("test.mail");
mime.writeTo(fos);
----------------------------------------
but it does not store the whole message..only the headers are saved...

How to save the whole thing...
Also if there are attachments i need to store those also..

Also how to read the message back from file thru Javamail.

I could not find any specific answer for this problem in this list.

Pls help.

Tia.
Yogesh.

   <<Less

Re: Saving message to a file using Javamail.

Posted By:   Eric_L  
Posted On:   Friday, July 27, 2001 04:11 AM

Yeah, does anyone out there have any suggestion on how I should save the messages in my local? I've tried using random access file and retrieve them later using file.seek but it's not efficient and I have to waste alot of storage space due to the need to specify a certain amount of bytes for a record.

I realise that Netscape merely append all its inbox mail in a particular file n retrieve them later. I mean how do they know where a new mail starts? Do help pls. I only need guidance and ideas.

About | Sitemap | Contact