Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void connect() {
- try {
- if (imapStore == null) {
- Session emailSession = Session.getInstance(properties, null);
- // emailSession.setDebug(true);
- imapStore = (IMAPStore) emailSession.getStore(mailProtocol);
- imapStore.connect(host, username, password);
- }
- } catch (Exception e) {
- log.error("unable to connect", e);
- }
- }
- public boolean isConnected() {
- return imapStore != null && imapStore.isConnected() ? true : false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement