Package javaforce

Class POP3

java.lang.Object
javaforce.POP3

public class POP3 extends Object
POP3 client class.
  • Field Details

  • Constructor Details

    • POP3

      public POP3()
  • Method Details

    • connect

      public boolean connect(String host, int port) throws Exception
      Connects to an insecure POP3 server.
      Parameters:
      host - = POP3 server
      port - = port to connect (default = 25 or 587)
      Throws:
      Exception
    • connectSSL

      public boolean connectSSL(String host, int port) throws Exception
      Connects to a secure POP3 server.
      Parameters:
      host - = POP3 server
      port - = port to connect (default = 465)
      Throws:
      Exception
    • disconnect

      public void disconnect() throws Exception
      Disconnect from POP3 Server.
      Throws:
      Exception
    • setLogging

      public static void setLogging(boolean state)
      Set debug logging state.
    • setLog

      public static void setLog(int id)
    • login

      public boolean login() throws Exception
      Sends HELO command.
      Throws:
      Exception
    • auth

      public boolean auth(String user, String pass, String type) throws Exception
      Authenticates with POP3 Server using APOP.
      Parameters:
      user - = username
      pass - = password
      type - = AUTH_LOGIN or AUTH_APOP
      Throws:
      Exception
    • auth

      public boolean auth(String user, String pass) throws Exception
      Authenticates with POP3 Server using AUTH_LOGIN type.
      Parameters:
      user - = username
      pass - = password
      Throws:
      Exception
    • logout

      public void logout() throws Exception
      Send QUIT command.
      Throws:
      Exception
    • cmd

      public void cmd(String cmd) throws Exception
      Send any command to server.
      Throws:
      Exception
    • starttls

      public void starttls() throws Exception
      Secures connection using STARTTLS command.
      Throws:
      Exception
    • list

      public POP3.Message[] list() throws Exception
      List messages available.
      Throws:
      Exception
    • get

      public byte[] get(int idx) throws Exception
      Get message
      Throws:
      Exception
    • get

      public void get(int idx, OutputStream os) throws Exception
      Get message
      Throws:
      Exception
    • delete

      public boolean delete(int idx) throws Exception
      Delete message on server.
      Throws:
      Exception