This content has been marked as final. Show 2 replies
There's two different approaches...
1. Switch the protocol you're using from "imap" to "imaps" depending on whether you want SSL or not.
Note that you'll also need to adjust the names of the properties you're setting to be "mail.imap.*" or
2. Always use the "imap" protocol, and turn on use of SSL by setting the "mail.imap.ssl.enable"
property to "true".
In neither case should you need to set the "port" property; the correct default port will be chosen based
on whether you're using SSL or not.
Also, unless you're using methods specific to the IMAPStore class, you don't need to cast the returned
Store object to an IMAPStore object. Most of the time just using the Store API is sufficient.
Thanks a lot! The answer is very useful for me!