I use the following code to programmatically check email.
Properties properties = new Properties(); Session emailSession = Session.getDefaultInstance(properties); Store store = emailSession.getStore("imap"); store.connect(host, user, password); if(store.isConnected()){ System.out.println("true"); }
he is currently throwing an exception
javax.mail.MessagingException: Connection dropped by server?; nested exception is: java.io.IOException: Connection dropped by server? at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:670) at javax.mail.Service.connect(Service.java:295) at javax.mail.Service.connect(Service.java:176) at com.**.channel.type.IMAPValidator.fetch(IMAPValidator.java:23) at com.**.channel.type.IMAPValidator.main(IMAPValidator.java:47)
However, if I use
emailSession.getStore("imaps");
then it successfully connects to the YAHOO IMAP server.
What I know, "imaps" means "safe."
What I donβt know, why I canβt just use "imap"?
source share