try using the pop3 api (available from sun's site).i have developed a mail client if you want you can have the code. pop3 api does most (read not all) the jobs for you, just have to use the functions correctly hope this helps
Don't get me started about those stupid light bulbs.