Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.mail imap critical problems

sahahars shalev
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am working on a project on a short dead line of java mail simple client
i have some problems,wondering you can help.
the next code was working! for pop3 but i want to menage
several folders and handel messages between them

<font size=2><pre>
public void initialData(){
// Get system properties
props = System.getProperties();
// Setup mail server
// Get session
session = Session.getDefaultInstance(props, null);
try {
// Get the store
//store = session.getStore("pop3");
store = session.getStore("imap");
store.connect(,,;//host, username, password
} catch(Exception e) {
assuming that all the data members of my program delivers
the right initial data(e,g.-host, user name,password)
1)how do i create several phisical folders
2) do i need to do changes so the program will work as well in "imap" in terms of message hendeling :getting setting ,copying from one folder to another
3)in other part of the program i have an inner anonymous class .
the outer class have private data member
Javax.Mail.Message messageArray[];
it initielised : messageArray=folder.getMessages();
and works fine ,when the inner class needs to use the
messageArray messages it menage to recognize fields like
Subject ,From ,even indicate the contant as
instanceof Multipart but i cant operate any method on the ((Multipart)contant) unless i fetch the messages from the folder again
the code above throws Exception
Operation timed out: no further information;
any help would be apricciated
eMail me to
if you can send me some code
thank you
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic