Class JDPGetMail
java.lang.Object
|
+----JDPGetMail
- public class JDPGetMail
- extends Object
Class JDPGetMail represents a simple Email class for retreiving email from a POP3
mail server.
-
JDPGetMail(JDPUser, String)
- Creates an Email Retreiver.
-
closePort()
-
-
connect(String, String)
- Connect the POP server.
-
getAttachments()
- Retrieve a list of all the attachments
-
getDate()
- Retrieve the date/time of the current message
-
getFromAddress()
- Retrieve the from address of the current message
-
getMessage()
- Retrieve the message of the current message
-
getMessageCount()
- Get the number of messages just retrieved.
-
getSubject()
- Retrieve the subject of the current message
-
getToAddress()
- Retrieve the to address of the current message
-
removeMessage(int)
- Remove a message from the POP server.
-
retrieveMessage(int)
- Retrieve Messages from the POP server.
-
retrieveMessages(String, String)
- Retrieve Messages from the POP server.
-
setAttachmentDir(String)
- Set the directory to place attachments (the default is temp)
-
setMessagePointer(int)
- Set the pointer to the desired message
JDPGetMail
public JDPGetMail(JDPUser user,
String host)
- Creates an Email Retreiver.
- Parameters:
- host - the domain name of the mail server (eg. 'mail.myserver.com').
connect
public int connect(String user,
String password)
- Connect the POP server.
- Parameters:
- user - the user to retrieve email for.
- password - the password of the email user.
- Returns:
- the number of messages available.
retrieveMessage
public int retrieveMessage(int messageNum)
- Retrieve Messages from the POP server.
- Parameters:
- user - the user to retrieve email for.
- password - the password of the email user.
- Returns:
- the number of messages retrieved.
retrieveMessages
public int retrieveMessages(String user,
String password)
- Retrieve Messages from the POP server.
- Parameters:
- user - the user to retrieve email for.
- password - the password of the email user.
- Returns:
- the number of messages retrieved.
removeMessage
public boolean removeMessage(int messageNumber)
- Remove a message from the POP server.
- Parameters:
- the - message number to remove.
- Returns:
- the status of the operation.
getMessageCount
public int getMessageCount()
- Get the number of messages just retrieved.
- Returns:
- the number of messages retrieved.
setAttachmentDir
public void setAttachmentDir(String dir)
- Set the directory to place attachments (the default is temp)
- Parameters:
- the - directory to place attachments
setMessagePointer
public boolean setMessagePointer(int pointer)
- Set the pointer to the desired message
- Parameters:
- pointer - the pointer on the desired message
- Returns:
- true if pointer is valid.
getFromAddress
public String getFromAddress()
- Retrieve the from address of the current message
- Returns:
- the from address of the current message
getSubject
public String getSubject()
- Retrieve the subject of the current message
- Returns:
- the subject of the current message
getToAddress
public String getToAddress()
- Retrieve the to address of the current message
- Returns:
- the to address of the current message
getDate
public String getDate()
- Retrieve the date/time of the current message
- Returns:
- the date/time of the current message
getMessage
public String getMessage()
- Retrieve the message of the current message
- Returns:
- the message of the current message
getAttachments
public String[] getAttachments()
- Retrieve a list of all the attachments
- Returns:
- a list of all the attachments
closePort
public boolean closePort()