dcsimg
unable to retrieve data from Exchange server..please help me...
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Abhishek_Ranjan
Posted On:   Wednesday, May 2, 2001 05:13 AM

I want to fetch the folder list in Exchange server but I am unable to do that.I am able to get connected but finally I get the following error message which I am writing it down. DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems,Inc] 220 sandesh.hyd.esoft.com ESMTP Server(Microsoft Exchange Internet Mail Service 5.5.2650.21)ready Exception in thread "main" javax.mail.MessagingException:220 sandesh.hyd.esoft.com ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.2650.21) ready; nested exception is : com.sun.mail.iap.ConnectionException:220 sandesh.hyd.esoft.com ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.2650.21)ready at com.   More>>

I want to fetch the folder list in Exchange server but I am unable to do that.I am able to get connected but finally I get the following error message which I am writing it down.

DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems,Inc]
220 sandesh.hyd.esoft.com ESMTP Server(Microsoft Exchange Internet Mail Service 5.5.2650.21)ready
Exception in thread "main" javax.mail.MessagingException:220 sandesh.hyd.esoft.com ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.2650.21) ready;
nested exception is :
com.sun.mail.iap.ConnectionException:220 sandesh.hyd.esoft.com ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.2650.21)ready
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:296)
at javax.mail.Service.connect(Service:java:234)
at javax.mail.Service.connect(Service.java:135)
at GetMessageExample.main(GetMessageExample.java,Compiled Code)

I am using imap as my protocol.

   <<Less

Re: unable to retrieve data from Exchange server..please help me...

Posted By:   vijay_M  
Posted On:   Monday, May 14, 2001 01:18 AM

Check up whether you have given correct user name , password and your mail server.
Suppose if you want to retrieve messages from yahoo and user nameis vijay and password is ram.then you have to mention in that code like this;

username:vijay
password:ram
server:yahoo.com or Ipaddress

Re: unable to retrieve data from Exchange server..please help me...

Posted By:   venkat_subramanian  
Posted On:   Wednesday, May 9, 2001 01:21 PM

I could use IMAP to list private folders, shared folders etc and list messages on them. Make sure IMAP service is running on the exchange server. Check event log on exchange server for IMAP errors also.



Eg.,
public class GetMessage {
public static void main (String args[]) throws Exception {
String host = args[0];
String username = args[1];
String password = args[2];

// Create empty properties
Properties props = new Properties();

// Get session
Session session = Session.getInstance(props, null);

// Get the store
Store store = session.getStore("imap");
store.connect(host, username, password);

// Getting Inbox

// Get folder
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);

// Getting Public folders
// user need to have access
Store store2 = session.getStore("imap");
store2.connect("servername", "usrname", "pwd");
Folder folderarry[] = store2.getSharedNamespaces();

Folder salesFolder =folderarry[0].getFolder(pubFolderPath);

.....

About | Sitemap | Contact