|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.java4less.rmail.PopServer
The POP server class is used to retrieve messages from a POP3 server. It returns one object of type MailMsg for each message in the mailbox.
Example:
pop.connect("pop.mycompany.com","user","pwd"); // Connect
for (int i=1;i<=pop.msgs;i++) { // iterate on number of messages
MailMsg m=pop.retrieveMsg(i); // get message
pop.deleteMsg(i); // delete message// do here whatever you like with the MailMsg object (variable m)
}
pop.disconnect(); // disconnect
Field Summary | |
boolean |
debug
if true, the class will generate debug messages in the java console. |
ProgressSMTPListener |
liste
This listener receives the status of the connection when it changes, it sould only be used for feedback (visualization) purposes. |
java.lang.String |
msgFile
The file where the received message will be stored. |
int |
msgs
number of messages in the mailbox. |
boolean |
parseOnLine
|
int |
popPort
POP port. |
Constructor Summary | |
PopServer()
|
Method Summary | |
boolean |
connect(java.lang.String serverAdd,
java.lang.String userName,
java.lang.String userPwd)
connects and gets the number of messages in the mailbox. |
boolean |
deleteMsg(int num)
delete a message in the mailbox. |
boolean |
disconnect()
disconnects from the server. |
long |
getSizeMsg(int num)
returns the size in bytes of the message. |
MailMsg |
parseFromFile(java.lang.String f)
|
MailMsg |
parseMsg(boolean WeAreInPart,
MailMsgPart parentPart)
internal use. |
MailMsg |
retrieveMsg(int num)
retrieves a message from the mailbox. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int popPort
public ProgressSMTPListener liste
public int msgs
public java.lang.String msgFile
public boolean parseOnLine
public boolean debug
Constructor Detail |
public PopServer()
Method Detail |
public boolean connect(java.lang.String serverAdd, java.lang.String userName, java.lang.String userPwd)
connects and gets the number of messages in the mailbox. The parameters are, the server address (e.g. pop.mycompany.com, the user name and the password).
public MailMsg parseFromFile(java.lang.String f)
public MailMsg retrieveMsg(int num)
public MailMsg parseMsg(boolean WeAreInPart, MailMsgPart parentPart)
public long getSizeMsg(int num)
public boolean deleteMsg(int num)
public boolean disconnect()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |