p> 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 props.put("mail.imap.host",inputData.data.getHost());//host
// Get session session = Session.getDefaultInstance(props, null);
try { // Get the store //store = session.getStore("pop3"); store = session.getStore("imap"); if(!store.isConnected()){ //CONNECT IF NOT ALLREDY CONNECTED store.connect(inputData.data.getHost(), inputData.data.getUserName(), inputData.data.getPassword());//host, username, password } } catch(Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); }
}
</pre>&l t;/font> <p> 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 shaharke1@bezeqint.net if you can send me some code thank you shahar