


Hi
Anybody know how can I leave the session open after retriving the messages from POP3 ?
this is my code
Thanks
Collection mensajesAL = new ArrayList();
Properties props = System.getProperties();
Session session = Session.getDefaultInstance(props,null);
try
{
this.setStore(session.getStore("pop3"));
this.getStore().connect(incomingServer,port,userId,userPwd);
this.setFolder(store.getFolder("INBOX"));
this.getFolder().open(Folder.READ_ONLY);
int cant = this.getFolder().getMessageCount();
Message message[] = folder.getMessages(from,to);
for(int i=0 ; i < message.length; i++)
{
Email m =new Email();
//Cargo los mensajes en objetos Email proxy !
this.message2Email(message,m,1);
mensajesAL.add(m);
}
this.closeFolderAndStore();
}
catch(NoSuchProviderException e)
{
throw new EmailException("NoSuchProviderException in DAPOPEmail.readInbox()");
}
catch(MessagingException e)
{
throw new EmailException("Messaging in DAPOPEmail.readInbox()");
}
return mensajesAL;
