Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sample reading mails JavaMail

ivan atrabajo
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to use JavaMail with GWT from read mails in a Gmail account but I have this error:

ERROR: javax.mail.NoSuchProviderException: Unable to locate provider for protocol: imaps

That is my code in server package:

public MyUserServiceImpl() {
String host = "";
String port = "993";
String user = "";
String pass = "pass";

Properties props = System.getProperties();
props.setProperty("", "imaps");
props.setProperty("", host);
props.setProperty("mail.imaps.port", port);
props.setProperty("mail.imap.socketFactory.class", "");
props.setProperty("mail.imap.socketFactory.fallback", "false");

Session session = Session.getDefaultInstance(props, null);
Store store = session.getStore();
store.connect(host, user, pass);
catch(Exception e){
System.out.println("ERROR: " + e);

Thanks for the help.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic