Click here to Skip to main content
15,435,841 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
using javamail program,how to read inbox of my AOL account..
Posted

Repost of question about reading from GMX account.
 
Share this answer
 
Finally i developed the code in jsp..and its working well..all is well..


XML
<%! String host,username,password;%>


<%!Store store;%>
  <%!Folder folder;%>

<%
 host="pop.aol.com";
 username="username@aol.com";
 password="password";

Properties props = new Properties();


Session mailsession = Session.getDefaultInstance(props, null);


store = mailsession.getStore("pop3");
store.connect(host, username, password);

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


Message message[] = folder.getMessages();

int count=folder.getMessageCount();
out.print(count);

for (int i=0, n=message.length; i<n; i++) {
   out.println(i + ": " + message[i].getFrom()[0]
     + "\t" + message[i].getSubject());
}


// Close connection
folder.close(false);
store.close();
%>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900