Package org.apache.commons.net.pop3

Examples of org.apache.commons.net.pop3.POP3Client.login()


    // initialize POP3 client
    POP3Client client = new POP3Client();
    client.connect(POP3_HOST, POP3_PORT);

    // Login
    boolean loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    // LIST all messages
    POP3MessageInfo[] info = client.listMessages();
    assertThat(info.length, equalTo(2));
View Full Code Here


    // reconnect
    client.connect(POP3_HOST, POP3_PORT);

    // Login
    loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    info = client.listMessages();
    assertThat(info.length, equalTo(0));
View Full Code Here

    // initialize POP3 client
    POP3Client client = new POP3Client();
    client.connect(POP3_HOST, POP3_PORT);

    // Login
    boolean loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    // LIST all messages
    POP3MessageInfo[] info = client.listMessages();
    assertThat(info.length, equalTo(1));
View Full Code Here

    // initialize POP3 client
    POP3Client client = new POP3Client();
    client.connect(POP3_HOST, POP3_PORT);

    boolean loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    POP3MessageInfo info = client.status();
    assertThat(info.size, equalTo((int) (mailSizeRegular + mailSizeAttach)));
    assertThat(info.number, equalTo(2));
View Full Code Here

    // initialize POP3 client
    POP3Client client = new POP3Client();
    client.connect(POP3_HOST, POP3_PORT);

    // Login
    boolean loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    // RETR message
    Reader retrMessage = client.retrieveMessage(1);
    assertThat(retrMessage, notNullValue());
View Full Code Here

    // initialize POP3 client
    POP3Client client = new POP3Client();
    client.connect(POP3_HOST, POP3_PORT);

    // Login
    boolean loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    // TOP message with all lines
    Reader topMessage = client.retrieveMessageTop(1, 1000);
    assertThat(topMessage, notNullValue());
View Full Code Here

    // initialize POP3 client
    POP3Client client = new POP3Client();
    client.connect(POP3_HOST, POP3_PORT);

    boolean loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    // LIST all messages
    POP3MessageInfo[] info = client.listMessages();
    assertThat(info.length, equalTo(2));
View Full Code Here

            System.exit(1);
        }

        try
        {
            if (!pop3.login(username, password))
            {
                System.err.println("Could not login to server.  Check password.");
                pop3.disconnect();
                System.exit(1);
            }
View Full Code Here

            System.exit(1);
        }

        try
        {
            if (!pop3.login(username, password))
            {
                System.err.println("Could not login to server.  Check password.");
                pop3.disconnect();
                System.exit(1);
            }
View Full Code Here

            System.exit(1);
        }

        try
        {
            if (!pop3.login(username, password))
            {
                System.err.println("Could not login to server.  Check password.");
                pop3.disconnect();
                System.exit(1);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.