com.ezprotocols.ezpop
Class EzPOP

java.lang.Object
  |
  +--com.ezprotocols.ezpop.EzPOP
All Implemented Interfaces:
java.io.Serializable

public class EzPOP
extends java.lang.Object
implements java.io.Serializable

EzPOP implements a POP3 client to retrieve e-mail from a Post Office Protocol (POP3) Server. Retrieving electronic mail has never been so easy!

Example:


 import com.EzProtocols.ezpop.*;

 // EzPOP Example : Retreives, prints and deletes all
 //e-mail from a POP Server.
 
 public class GetMail {

 public static void main(String[] args) {
   try{
     EzPOP ezPop = new EzPOP();

     //Set EzPOP component.
     ezPop.setMailServer("your.pop.server");
     ezPop.setUsername("username);
     ezPop.setPassword("secret");
     //Automatically delete mail after retreiving it.
     ezPop.setDelete(true);

     //Connects to POP Server.
     ezPop.connect();

     System.out.println("There is " + ezPop.getMessageCount() +
                        " mail(s) in the mailbox.");

     //Prints the content of all messages.
     Message[] messages = ezPop.getAllMessages();
     for(int i = 0; i< messages.length; i++){
       System.out.println("-Mail " + (i+1) +
                          " -\n" + messages[i]);
     }

     //Disconnects from POP Server.
     ezPop.disconnect();

   }catch(EzPOPException ex){
     System.out.println(ex.getMessage());
   }
 }

}


See Also:
Serialized Form

Constructor Summary
EzPOP()
          Creates a new instance of EzPOP.
 
Method Summary
 void addEzPOPEventListener(EzPOPEventListener client)
          Registers to receive events (serverReply).
 void connect()
          Connects to POP Server.
 void deleteMessage(int message)
          Deletes a message in the mailbox.
 void disconnect()
          Disconnects from the POP Server.
 java.lang.String getAbout()
          Gets information about EzPOP.
 Message[] getAllMessages()
          Gets all message(s) in the mailbox.
 boolean getConnected()
          Indicates if currently connected to the POP Server.
 int getMailPort()
          Gets the POP Server port number.
 java.lang.String getMailServer()
          Gets the POP server address.
 Message getMessage(int message)
          Gets a specific message from the mailbox.
 int getMessageCount()
          Gets the number of messages in the mailbox.
 java.lang.String getMessageUIDL(int message)
          Gets the UIDL of a message.
 java.lang.String getPassword()
          Gets the user password used for authentication.
 java.lang.String getSerialKey()
          Gets the Serial Key used to activate the full version.
 int getTimeout()
          Gets the Timeout to open the connection with the SMTP Server.
 java.lang.String getTopOfMessage(int message, int nbLines)
          Gets summary of a message in the mailbox.
 java.lang.String getUsername()
          Gets the username used for authentication.
 java.lang.String getVersion()
          Gets the version number of EzPOP.
 boolean isDelete()
          Indicates if EzPOP automatically deletes a message after reading it.
 void removeEzPOPEventListener(EzPOPEventListener client)
          UnRegisters from receiving events.
 void setAbout(java.lang.String s)
           
 void setDelete(boolean d)
          Determines if EzPOP automatically deletes a message after reading it.
 void setMailPort(int port)
          Sets the SMTP Server port (Default is 110).
 void setMailServer(java.lang.String s)
          Sets the address of the POP Server.
 void setPassword(java.lang.String p)
          Sets the user password for authentication with the POP Server.
 void setSerialKey(java.lang.String k)
          Sets the Serial Key to activate the full version.
 void setTimeout(int t)
          Sets the Timeout to open the connection with the SMTP Server.
 void setUsername(java.lang.String u)
          Sets the username for authentication with the POP Server.
 void setVersion(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EzPOP

public EzPOP()
Creates a new instance of EzPOP.
Method Detail

connect

public void connect()
             throws EzPOPException
Connects to POP Server.

getMessageCount

public int getMessageCount()
                    throws EzPOPException
Gets the number of messages in the mailbox.

getMessageUIDL

public java.lang.String getMessageUIDL(int message)
                                throws EzPOPException
Gets the UIDL of a message.

getTopOfMessage

public java.lang.String getTopOfMessage(int message,
                                        int nbLines)
                                 throws EzPOPException
Gets summary of a message in the mailbox.

getMessage

public Message getMessage(int message)
                   throws EzPOPException
Gets a specific message from the mailbox.

getAllMessages

public Message[] getAllMessages()
                         throws EzPOPException
Gets all message(s) in the mailbox.

deleteMessage

public void deleteMessage(int message)
                   throws EzPOPException
Deletes a message in the mailbox.

disconnect

public void disconnect()
                throws EzPOPException
Disconnects from the POP Server.

addEzPOPEventListener

public void addEzPOPEventListener(EzPOPEventListener client)
Registers to receive events (serverReply).

removeEzPOPEventListener

public void removeEzPOPEventListener(EzPOPEventListener client)
UnRegisters from receiving events.

setVersion

public void setVersion(java.lang.String s)

setAbout

public void setAbout(java.lang.String s)

setSerialKey

public void setSerialKey(java.lang.String k)
Sets the Serial Key to activate the full version.

setMailServer

public void setMailServer(java.lang.String s)
Sets the address of the POP Server.

setUsername

public void setUsername(java.lang.String u)
Sets the username for authentication with the POP Server.

setTimeout

public void setTimeout(int t)
Sets the Timeout to open the connection with the SMTP Server. Default is 0 and implies that the option is disabled (Timeout = infinity).

setPassword

public void setPassword(java.lang.String p)
Sets the user password for authentication with the POP Server.

setMailPort

public void setMailPort(int port)
Sets the SMTP Server port (Default is 110).

setDelete

public void setDelete(boolean d)
Determines if EzPOP automatically deletes a message after reading it.

getConnected

public boolean getConnected()
Indicates if currently connected to the POP Server.

getUsername

public java.lang.String getUsername()
Gets the username used for authentication.

getPassword

public java.lang.String getPassword()
Gets the user password used for authentication.

getMailServer

public java.lang.String getMailServer()
Gets the POP server address.

getMailPort

public int getMailPort()
Gets the POP Server port number.

getVersion

public java.lang.String getVersion()
Gets the version number of EzPOP.

getTimeout

public int getTimeout()
Gets the Timeout to open the connection with the SMTP Server. Default is 0 and implies that the option is disabled (Timeout = infinity).

getAbout

public java.lang.String getAbout()
Gets information about EzPOP.

getSerialKey

public java.lang.String getSerialKey()
Gets the Serial Key used to activate the full version.

isDelete

public boolean isDelete()
Indicates if EzPOP automatically deletes a message after reading it.


Copyright © EzProtocols.com All Rights Reserved.