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.


Constructor Index

 o JDPGetMail(JDPUser, String)
Creates an Email Retreiver.

Method Index

 o closePort()
 o connect(String, String)
Connect the POP server.
 o getAttachments()
Retrieve a list of all the attachments
 o getDate()
Retrieve the date/time of the current message
 o getFromAddress()
Retrieve the from address of the current message
 o getMessage()
Retrieve the message of the current message
 o getMessageCount()
Get the number of messages just retrieved.
 o getSubject()
Retrieve the subject of the current message
 o getToAddress()
Retrieve the to address of the current message
 o removeMessage(int)
Remove a message from the POP server.
 o retrieveMessage(int)
Retrieve Messages from the POP server.
 o retrieveMessages(String, String)
Retrieve Messages from the POP server.
 o setAttachmentDir(String)
Set the directory to place attachments (the default is temp)
 o setMessagePointer(int)
Set the pointer to the desired message

Constructors

 o JDPGetMail
 public JDPGetMail(JDPUser user,
                   String host)
Creates an Email Retreiver.

Parameters:
host - the domain name of the mail server (eg. 'mail.myserver.com').

Methods

 o 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.
 o 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.
 o 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.
 o 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.
 o getMessageCount
 public int getMessageCount()
Get the number of messages just retrieved.

Returns:
the number of messages retrieved.
 o setAttachmentDir
 public void setAttachmentDir(String dir)
Set the directory to place attachments (the default is temp)

Parameters:
the - directory to place attachments
 o 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.
 o getFromAddress
 public String getFromAddress()
Retrieve the from address of the current message

Returns:
the from address of the current message
 o getSubject
 public String getSubject()
Retrieve the subject of the current message

Returns:
the subject of the current message
 o getToAddress
 public String getToAddress()
Retrieve the to address of the current message

Returns:
the to address of the current message
 o getDate
 public String getDate()
Retrieve the date/time of the current message

Returns:
the date/time of the current message
 o getMessage
 public String getMessage()
Retrieve the message of the current message

Returns:
the message of the current message
 o getAttachments
 public String[] getAttachments()
Retrieve a list of all the attachments

Returns:
a list of all the attachments
 o closePort
 public boolean closePort()