Results 1 to 2 of 2
  1. #1
    fhamumtaz is offline Member
    Join Date
    Feb 2017
    Rep Power

    Default Java Mail to Read The Mail

    I'm getting this error when tried to read mail using JavaMail. Please let me know how to resolve this error :

    Part of my code :

    private void referhEmail(){
    try {
    Properties props = new Properties();
    props.setProperty("", "pop3");
    props.setProperty("mail.pop3.port", "110");
    props.setProperty("", "localhost");

    Session session = Session.getInstance(props);
    final Store store = session.getStore("pop3");
    store.connect("localhost","xxxx@localhost", "xxx");

    And the error :

    javax.mail.AuthenticationFailedException: Username or password is invalid or incorrect.
    at com.sun.mail.pop3.POP3Store.protocolConnect(POP3St
    at javax.mail.Service.connect(
    at javax.mail.Service.connect(
    at emailclientgamal.EmailClientGamal.referhEmail(Emai
    at emailclientgamal.EmailClientGamal.connect(EmailCli
    at emailclientgamal.EmailClientGamal.main(EmailClient

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    The Netherlands
    Rep Power

    Default Re: Java Mail to Read The Mail

    My guess is that the username or password is invalid or incorrect. Solution: enter the right username and password.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

Similar Threads

  1. Replies: 5
    Last Post: 03-21-2014, 02:03 PM
  2. trying to sendin mail with java mail api
    By akhilsrivastava in forum Advanced Java
    Replies: 1
    Last Post: 04-04-2012, 10:34 PM
  3. Replies: 2
    Last Post: 07-25-2009, 10:36 AM
  4. Replies: 2
    Last Post: 06-04-2009, 02:42 PM
  5. Replies: 2
    Last Post: 05-05-2008, 07:01 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts