dcsimg
saving emails to external files
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   alan_mccrimmon
Posted On:   Wednesday, November 6, 2002 02:48 AM

hi there I was wondering if anyone could help me pls, I need to create a program that logs onto a users imap or pop 3 email account and gets all of the emails, It then needs to store the information contained in these emails in an external file such as a text document by header, subject and body (same emails stored 3 times in each of these). Any help would be greatly appreciated. Alan.

Re: saving emails to external files

Posted By:   moon_departed  
Posted On:   Tuesday, November 26, 2002 12:04 AM

after you have retrieved you mail, try this:

MimeMessage mm = (MimeMessage) message;
FileOutputStream fos = new FileOutputStream("test.email");
mm.writeTo(fos);

it should output your message to a file called "test.email". hopefully this will help.

Re: saving emails to external files

Posted By:   Vivek_Adlakha  
Posted On:   Wednesday, November 6, 2002 08:01 AM

sure did you read the JGURU tutorial on JAVAMAIL it is very good and will definitely answer your question.

Send me an email if you need more help.

Vivek
About | Sitemap | Contact