Mysterious exceptional error(connection to IMAP mail server)
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   King_chin
Posted On:   Friday, September 5, 2008 02:32 PM

My aim is to read mails in my organization's mail server. This is the code I use to connect to the mail server and the exception error I am getting. Please advise what is the problem with my code. import javax.mail.*; import javax.mail.internet.*; import java.util.*; public class readm { public static void main(String args[]) throws MessagingException { Properties props =System.getProperties(); Session session = Session.getDefaultInstance(props, null); session.setDebug(true); Store store = session.getStore("imap"); store.connect("gwes.wide.corp.gwes.com", 25 , "user", "password"); }   More>>

My aim is to read mails in my organization's mail server. This is the code I use to connect to the mail server and the exception error I am getting. Please advise what is the problem with my code.


			

import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;

public class readm
{
public static void main(String args[]) throws MessagingException
{
Properties props =System.getProperties();
Session session = Session.getDefaultInstance(props, null);
session.setDebug(true);
Store store = session.getStore("imap");
store.connect("gwes.wide.corp.gwes.com", 25 , "user", "password");

}

}



			
DEBUG: setDebug: JavaMail version 1.4.1
DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
220 gwes.wide.corp.gwes.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Fri, 5 Sep 2008 14:04:47 -0400
Exception in thread "main" javax.mail.MessagingException: 220 gwes.wide.corp.gwes.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Fri, 5 Sep 2008 14:04:47 -0400 ;
nested exception is:
com.sun.mail.iap.ConnectionException: 220 gwes.wide.corp.gwes.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Fri, 5 Sep 2008 14:04:47 -0400
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:569)
at javax.mail.Service.connect(Service.java:288)
at readm.main(readm.java:13)
Caused by: com.sun.mail.iap.ConnectionException: 220 gwes.wide.corp.gwes.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Fri, 5 Sep 2008 14:04:47 -0400
at com.sun.mail.imap.protocol.IMAPProtocol.processGreeting(IMAPProtocol.java:230)
at com.sun.mail.iap.Protocol. (Protocol.java:114)
at com.sun.mail.imap.protocol.IMAPProtocol. (IMAPProtocol.java:104)
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:538)
... 2 more
   <<Less
About | Sitemap | Contact