jasp.jmail
Class POP3

java.lang.Object
  extended byjasp.jmail.POP3

public class POP3
extends java.lang.Object

Implements the JMail.POP3 components in Java


Constructor Summary
POP3()
           
 
Method Summary
 void Connect(java.lang.String username, java.lang.String pass, java.lang.String server)
           
 void Connect(java.lang.String username, java.lang.String pass, java.lang.String server, int port)
          Opens the connection to the POP3 Server, the port argument is optional and defaults to 110.
 void DeleteMessages()
          Deletes all messages from the mailer server
 void DeleteSingleMessage(int messageid)
          Deletes the single message on the mail server.
 void Disconnect()
          Closes the connection to the server
 void DownloadHeaders()
          Downloads all headers and adds them in the Messages Collection
 void DownloadMessages()
          Download all messages
 void DownloadSingleHeader(int messageid)
          Downloads the headers of a single Message,and adds them in the Messages Collection
 Message DownloadSingleMessage(int index)
          Downloads , returns and puts the specifeid message in the Messages Collection
 void DownloadUnreadMessages()
          Downloads all unread e-mails, the e-mails are added to Messages collection.
 int getCount()
           
 int GetLastUnreadMessage()
          Returns the ID of the first unread message , Return 0 if the no Message has been accessed, -1 if this command is not supported by the mail server.
 Messages getMessages()
          Return the Messages object through which can access the Message
 java.lang.String GetMessageUID(int messageid)
          Returns the server's uniquie id for this message
 int getSize()
          Returns the total size of your mailbox in bytes
 java.lang.String Log()
          This is the log create by JMail when the logging is set to TRUE
 void setLogging(boolean log)
          Enables or disables the logging int JMail , Defualt value is false.
 void setTimeout(int t)
          Tomout in seconds for the socket used
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

POP3

public POP3()
Method Detail

Connect

public void Connect(java.lang.String username,
                    java.lang.String pass,
                    java.lang.String server,
                    int port)
             throws java.lang.Exception
Opens the connection to the POP3 Server, the port argument is optional and defaults to 110.

Throws:
java.lang.Exception

Connect

public void Connect(java.lang.String username,
                    java.lang.String pass,
                    java.lang.String server)
             throws java.lang.Exception
Throws:
java.lang.Exception

DeleteMessages

public void DeleteMessages()
                    throws java.lang.Exception
Deletes all messages from the mailer server

Throws:
java.lang.Exception

DeleteSingleMessage

public void DeleteSingleMessage(int messageid)
                         throws java.lang.Exception
Deletes the single message on the mail server.

Throws:
java.lang.Exception

Disconnect

public void Disconnect()
Closes the connection to the server


DownloadHeaders

public void DownloadHeaders()
                     throws java.lang.Exception
Downloads all headers and adds them in the Messages Collection

Throws:
java.lang.Exception

DownloadMessages

public void DownloadMessages()
                      throws java.lang.Exception
Download all messages

Throws:
java.lang.Exception

DownloadSingleHeader

public void DownloadSingleHeader(int messageid)
                          throws java.lang.Exception
Downloads the headers of a single Message,and adds them in the Messages Collection

Throws:
java.lang.Exception

DownloadUnreadMessages

public void DownloadUnreadMessages()
                            throws java.lang.Exception
Downloads all unread e-mails, the e-mails are added to Messages collection. Note this command has been removed from the POP3 specification (RFC 1725) , so it may not supported by all mail servers

Throws:
java.lang.Exception

GetLastUnreadMessage

public int GetLastUnreadMessage()
Returns the ID of the first unread message , Return 0 if the no Message has been accessed, -1 if this command is not supported by the mail server. Notes: this command has been removed by the POP3 specification(RFC 1725), so it may not supported by all mail servers.


GetMessageUID

public java.lang.String GetMessageUID(int messageid)
                               throws java.lang.Exception
Returns the server's uniquie id for this message

Throws:
java.lang.Exception

getCount

public int getCount()

Log

public java.lang.String Log()
This is the log create by JMail when the logging is set to TRUE


setLogging

public void setLogging(boolean log)
Enables or disables the logging int JMail , Defualt value is false.


getMessages

public Messages getMessages()
Return the Messages object through which can access the Message


getSize

public int getSize()
Returns the total size of your mailbox in bytes


DownloadSingleMessage

public Message DownloadSingleMessage(int index)
                              throws java.lang.Exception
Downloads , returns and puts the specifeid message in the Messages Collection

Throws:
java.lang.Exception

setTimeout

public void setTimeout(int t)
Tomout in seconds for the socket used