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 = "imap.gmail.com";
                String port = "993";
                String user = "u...@gmail.com";
                String pass = "pass";

                Properties props = System.getProperties();
                props.setProperty("mail.store.protocol", "imaps");
                props.setProperty("mail.imaps.host", host);
                props.setProperty("mail.imaps.port", port);
                props.setProperty("mail.imap.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
                props.setProperty("mail.imap.socketFactory.fallback", "false");

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

Thanks for the help.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to