These are 2 seperate questions. Niether of which belong in the Swing forum. I am going to move this to the Other
Java API's forum where you can ask questions about the JavaMail API (first part of your question).
Once you have figured out how to get an attatchment
you should ask questions about reading a text file in the IO and Streams forum.