Package javaforce
Class POP3
java.lang.Object
javaforce.POP3
POP3 client class.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAuthenticates with POP3 Server using AUTH_LOGIN type.booleanAuthenticates with POP3 Server using APOP.voidSend any command to server.booleanConnects to an insecure POP3 server.booleanconnectSSL(String host, int port) Connects to a secure POP3 server.booleandelete(int idx) Delete message on server.voidDisconnect from POP3 Server.byte[]get(int idx) Get messagevoidget(int idx, OutputStream os) Get messagelist()List messages available.booleanlogin()Sends HELO command.voidlogout()Send QUIT command.static voidsetLog(int id) static voidsetLogging(boolean state) Set debug logging state.voidstarttls()Secures connection using STARTTLS command.
-
Field Details
-
debug
public static boolean debug -
debug_log
public static boolean debug_log -
log
public static int log -
response
Holds the response strings from the last executed command -
PORT
public static final int PORT- See Also:
-
TLSPORT
public static final int TLSPORT- See Also:
-
SSLPORT
public static final int SSLPORT- See Also:
-
AUTH_LOGIN
- See Also:
-
AUTH_APOP
- See Also:
-
-
Constructor Details
-
POP3
public POP3()
-
-
Method Details
-
connect
Connects to an insecure POP3 server.- Parameters:
host- = POP3 serverport- = port to connect (default = 25 or 587)- Throws:
Exception
-
connectSSL
Connects to a secure POP3 server.- Parameters:
host- = POP3 serverport- = port to connect (default = 465)- Throws:
Exception
-
disconnect
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
Sends HELO command.- Throws:
Exception
-
auth
Authenticates with POP3 Server using APOP.- Parameters:
user- = usernamepass- = passwordtype- = AUTH_LOGIN or AUTH_APOP- Throws:
Exception
-
auth
Authenticates with POP3 Server using AUTH_LOGIN type.- Parameters:
user- = usernamepass- = password- Throws:
Exception
-
logout
Send QUIT command.- Throws:
Exception
-
cmd
Send any command to server.- Throws:
Exception
-
starttls
Secures connection using STARTTLS command.- Throws:
Exception
-
list
List messages available.- Throws:
Exception
-
get
Get message- Throws:
Exception
-
get
Get message- Throws:
Exception
-
delete
Delete message on server.- Throws:
Exception
-