Package com.sun.mail.imap

Examples of com.sun.mail.imap.IMAPSSLStore.connect()


    Map<String, Integer> folderList = new Hashtable<String, Integer>();

    try {
      IMAPSSLStore imapStore = new IMAPSSLStore(session, urlName);

      imapStore.connect();
      IMAPFolder startFolder;

      if (urlName.getFile() == null) {
        // There is no folder given
        startFolder = (IMAPFolder) imapStore.getDefaultFolder();
View Full Code Here


        }
        URLName urlName = new URLName(originURLName.getProtocol(), originURLName.getHost(),
          originURLName.getPort(), folder, originURLName.getUsername(), originURLName.getPassword());
   
        IMAPSSLStore imapStore = new IMAPSSLStore(session, urlName);
        imapStore.connect();
        IMAPFolder currentFolder;

        if (urlName.getFile() == null) {
          // There is no folder given
          currentFolder = (IMAPFolder) imapStore.getDefaultFolder();
View Full Code Here

    session.setDebug(debug);

    final URLName unusedUrlName = null;
    IMAPSSLStore store = new IMAPSSLStore(session, unusedUrlName);
    final String emptyPassword = "";
    store.connect(host, port, userEmail, emptyPassword);
    return store;
  }

  /**
   * Connects and authenticates to an SMTP server with XOAUTH. You must have
View Full Code Here

        props.put(OAuth2SaslClientFactory.OAUTH_TOKEN_PROP, accessToken);


        Session session = Session.getInstance(props);
        IMAPSSLStore store = new IMAPSSLStore(session, null);
        store.connect("imap.gmail.com", 993, emailAddress, "");
        return store;
    }
}
View Full Code Here

        URLName url = new URLName("imap", mailServerName, mailServerPort, "", mailUsername, mailPassword);

        Session session = Session.getInstance(sessionProperties, null);

        Store store = new IMAPSSLStore(session, url);
        store.connect();

        return store;
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.