EzPOP 1.1 javabean™ implements a POP3 client to retrieve e-mail from a Post Office Protocol (POP3) Server. Retrieving electronic mail has never been so easy!
Price : $35.00



[Try it!] [Buy it!]
[Methods]
[View Javadoc] [Download Javadoc]
[Example]


Principal methods
Method Name Description
EzPOP()
Creates a new instance of EzPOP.
connect() Connects to POP Server.
disconnect() Disconnects from the POP Server.
setUsername(String u) Sets the username for authentication with the POP Server.
setPassword(String p) Sets the user password for authentication with the POP Server.
setMailServer(String s) Sets the address of the POP Server.
setMailPort(int port) Sets the SMTP Server port (Default is 110).
getAllMessages() Gets all message(s) in the mailbox.
getMessage(int message) Gets a specific message from the mailbox.
getMessageUIDL(int message) Gets the UIDL of a message.
getMessageCount() Gets the number of messages in the mailbox.
getTopOfMessage(int message,int nbLines) Gets summary of a message in the mailbox.
deleteMessage(int message) Deletes a message in the mailbox.
setDelete(boolean d) Determines if EzPOP automatically deletes a message after reading it.
setSerialKey(String k) Sets the Serial Key to activate the full version.


Example : GetMail.java

import com.ezjavabeans.ezpop.*;

/** EzPOP Example : Retreives, prints and deletes all
 *  the 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 deletes 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());
    }
  }

}

JAVA and all JAVA-based marks are trade-marks or registered trade-marks of
Sun Microsystems, Inc. in the U. S. and other countries.