Class Mailbox


public class Mailbox extends MailFolder
This class handles the connection to a POP3 server. It is used for retrieving folders and mails. Note that this is only for internal use please use the static method connectPOP3 instead.
  • Method Details

    • connectPOP3

      public static Mailbox connectPOP3(MailConnection con, String mailserver, String user, String password, int port, boolean useSSL) throws Exception
      Connect to a POP3 mailserver
      Parameters:
      mailserver - the address
      user - the username
      password - the password
      port - the port
      useSSL - true if SSL should be used.
      Returns:
      the new Mailbox connection
      Throws:
      Exception
    • connectIMAP

      public static Mailbox connectIMAP(MailConnection con, String mailserver, String user, String password, boolean useSSL) throws Exception
      Connects to a mailbox using IMAP
      Parameters:
      mailserver -
      user -
      password -
      Returns:
      Throws:
      Exception
    • connectIMAP

      public static Mailbox connectIMAP(MailConnection con, String mailserver, String user, String password, boolean useSSL, Properties props) throws Exception
      Throws:
      Exception
    • connectGMail

      public static Mailbox connectGMail(MailConnection con, String user, String password) throws Exception
      Connect to a GMail server, this is actually a IMAPS connection with imap.googlemail.com
      Parameters:
      user - the GMail account
      password - the password
      Returns:
      the mailbox
      Throws:
      Exception
    • connectMs365

      public static Mailbox connectMs365(MailConnection con, String clientid, String clientSecret, String tenant, String mailUser) throws Exception
      Connect to a GMail server, this is actually a IMAPS connection with imap.googlemail.com
      Parameters:
      user - the GMail account
      password - the password
      Returns:
      the mailbox
      Throws:
      Exception
    • hasExpired

      public boolean hasExpired()
    • getInbox

      public MailFolder getInbox() throws Exception
      Returns the inbox
      Returns:
      the inbox as a MailFolder.
      Throws:
      Exception
    • close

      public void close()
      Close mailbox
      Overrides:
      close in class MailFolder