Java POP3 Component - javamail, POP3 Class, POP3 Bean, POP3 Object, POP3 Client, POP3 Control
Home Search Knowledge Base Support

Support

Click here for access to live sales support.

For technical support please submit a ticket to the Help Desk.

 

Java and .NET Help

iPod shuffle offer

For a limited time get the newly re-designed iPod shuffle free with qualifying purchase.

Click for details.


News

JSCAPE Secure FTP Server 7.0 Released
08/20/2010 03:31 AM

JSCAPE launches Employee Giving Program
07/03/2010 08:26 AM

SSH Factory 3.6 Released
07/03/2010 06:22 AM

Secure iNet Factory 8.5 Released
07/03/2010 06:07 AM

Secure FTP Factory 8.5 Released
07/03/2010 06:03 AM

Secure FTP Applet 6.2 Released
06/10/2010 02:23 PM

more...


Tutorials

Enabling Phone Authentication
04/08/2009 11:24 AM

Detecting and Handling Brute Force Password Attacks
01/29/2009 09:44 AM

Creating a Domain
12/15/2008 11:33 AM

Public key authentication with SFTP
10/02/2008 07:59 AM

Formatting MimeMessages using .NET
09/14/2008 04:31 PM

Communicating with an IMAP4 server in .NET
09/14/2008 03:54 PM

more...


Articles

Open up corporate data to your partners
08/03/2010 10:01 PM

Access vital corporate documents on the go
07/01/2010 02:15 PM

SFTP and Encryption
05/17/2010 09:52 PM

Streamlining web uploads with ZIP archives
12/14/2009 10:11 AM

Using regular expressions in complex trigger conditions
09/08/2009 07:42 AM

Using custom forms to automate business processes
07/03/2009 08:51 AM

more...


Feedback

Request a feature or component

Request a Java or .NET component


 

Java POP3 Component

The POP3 (Post Office Protocol v3) component provides a simple interface for retrieving electronic mail messages from a POP3 server. The POP3 component implements standards in RFC 1725 and RFC 1939. Download Secure iNet Factory Evaluation

Features

  • APOP and plain-text authentication - With built in support for both APOP (RFC 1939) and plain text authentication modes, the POP3 component provides authentication support for the most popular POP3 servers.
  • File attachment retrieval - A streamlined API provides easy to use methods for retrieving attachments from a POP3 message.
  • Automatic message delete support - A convenient method to optionally delete messages automatically after download from POP3 server.
  • TOP support - Per RFC 1939 the TOP command allows preview of the first X lines without downloading the entire message body.
  • POP SSL - Support for retrieving messages securely using POP SSL.

Code Example

The following example demonstrates how to retrieve email from a POP3 server.

/*
 * @(#)PopExample.java
 *
 * Copyright (c) 2001-2002 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JScape. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JScape.
 */

import com.jscape.inet.pop.*;
import com.jscape.inet.email.*;
import com.jscape.inet.mime.*;
import java.util.Enumeration;
import java.io.*;

public class PopExample {
    
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    
    // get messages from Pop mailbox
    public void getMessages(String hostname, String username, String passwordthrows PopException, 
    MimeException, IOException {
      
      // create new Pop instance  
        Pop pop = new Pop(hostname,username,password);
        
        // connect to POP3 server and login
        pop.connect();
        System.out.println("Retrieving messages...");
        
        // retrieve all messages from POP3 server
        Enumeration messages = pop.getMessages();
        if(!messages.hasMoreElements()) {
            System.out.println("No messages found");
        }
        
        // print out contents of each message to console
        while(messages.hasMoreElements()) {
            System.out.println("-- begin message --");
            EmailMessage msg = (EmailMessage)messages.nextElement();
            System.out.println(new String(msg.getMessage()));
            System.out.println("-- end message --");
            
            if(messages.hasMoreElements()) {
                System.out.print("ENTER for next message or type QUIT to quit: ");
                String command = reader.readLine();
                if(command.equalsIgnoreCase("quit")) {
                    break;
                }
            }
        }
        
        // disconnect from POP3 server
        pop.disconnect();
    }
    
    public static void main(String[] args) {
        String hostname;
        String username;
        String password;
        
        try {
            System.out.print("Enter POP3 hostname (e.g. mail.domain.com): ");
            hostname = reader.readLine();
            System.out.print("Enter POP3 Username: ");
            username = reader.readLine();
            System.out.print("Enter POP3 Password: ");
            password = reader.readLine();
            PopExample example = new PopExample();
            example.getMessages(hostname,username,password);
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }
}