This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes GWT and the fly likes Sample reading mails JavaMail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "Sample reading mails JavaMail" Watch "Sample reading mails JavaMail" New topic

Sample reading mails JavaMail

ivan atrabajo

Joined: Mar 22, 2012
Posts: 1
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.
I agree. Here's the link:
subject: Sample reading mails JavaMail
jQuery in Action, 3rd edition