| Author |
saving a email as a .eml
|
jordan ryan
Greenhorn
Joined: Oct 31, 2012
Posts: 19
|
|
Ok i can read an e-mail as attached below but i now need to be able to save this email as a .eml so i can view it when i click on the saved location.
I assumed a file writer then changing the println to Append would work but it didn't seem to work. is there any easy way around this.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
First of all, available() doesn't do what you think it does.
Second, all you need to do is write the message to a file. Using Java 7's try-with-resources:
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
jordan ryan
Greenhorn
Joined: Oct 31, 2012
Posts: 19
|
|
|
Thanks rob i done a bit of googling and worked this out last night, thanks for the quick reply would have been useful.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
You're welcome.
|
 |
 |
|
|
subject: saving a email as a .eml
|
|
|