The Artima Developer Community
Sponsored Link

Java Answers Forum
java.mail imap critical problems

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
shahar

Posts: 2
Nickname: shaharke
Registered: Mar, 2003

java.mail imap critical problems Posted: Mar 8, 2003 4:44 PM
Reply to this message Reply
Advertisement
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

Topic: SNMP Application using java Previous Topic   Next Topic Topic: Please help with school project

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use