I am trying to get access my GMail inbox using IMAP and JavaMail in a servlet like this:
Session imapSession = this.getSession(true);
System.out.println("getting the store");
Store store = imapSession.getStore("imap");
System.out.println("connecting to the store");
store.connect("imap.gmail.com", "address@gmail.com","password");
System.out.println("getting the Sent folder");
Folder folder = store.getFolder("INBOX");
System.out.println("Opening the folder in a READ_WRITE mode");
folder.open(Folder.READ_WRITE);
The servlet hangs and does nothing more when calling store.connect("imap.gmail.com", "address@gmail.com","password");
Any thoughts??
Thanks