Error using POP3 to fetch email using Javamail

Discussion in 'Java' started by moni, Sep 27, 2007.

  1. moni

    moni Guest

    Hi,

    I was trying to fetch the number of unread email messages in my yahoo/
    gmail inbox by using the Javamail, and JavaBeans Activation Framework
    by using the link

    http://timarcher.com/?q=node/52

    where I was putting

    POP3 pop3 = new POP3("yahoo.com", "manavi.monisha", "password");

    But I was continously getting an error.

    Error:
    In catch Unable to connect to POP3 server.
    javax.mail.MessagingException: Connect failed;
    nested exception is:
    java.net.ConnectException: Connection timed out: connect


    Please let me know if I would need to add some value to :

    Properties props = System.getProperties();

    or
    store.connect();

    Any help will be appreciated.

    Thanx...
    moni, Sep 27, 2007
    #1
    1. Advertising

  2. moni

    Guest

    On Sep 28, 2:30 am, moni <> wrote:
    > Hi,
    >
    > I was trying to fetch the number of unread email messages in my yahoo/
    > gmail inbox by using the Javamail, and JavaBeans Activation Framework
    > by using the link
    >
    > http://timarcher.com/?q=node/52
    >
    > where I was putting
    >
    > POP3 pop3 = new POP3("yahoo.com", "manavi.monisha", "password");
    >
    > But I was continously getting an error.
    >
    > Error:
    > In catch Unable to connect to POP3 server.
    > javax.mail.MessagingException: Connect failed;
    > nested exception is:
    > java.net.ConnectException: Connection timed out: connect
    >
    > Please let me know if I would need to add some value to :
    >
    > Properties props = System.getProperties();
    >
    > or
    > store.connect();
    >
    > Any help will be appreciated.
    >
    > Thanx...


    hi friends i m priytosh kumr from india
    , Sep 27, 2007
    #2
    1. Advertising

  3. moni

    Roedy Green Guest

    >I was trying to fetch the number of unread email messages in my yahoo/
    >gmail inbox by using the Javamail, and JavaBeans Activation Framework
    >by using the link

    too see some code that does work to connect and download messages,
    have a look at the source for the bulk remailer.
    http://mindprod.com/products1.html#BULK
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Sep 28, 2007
    #3
  4. moni

    Nigel Wade Guest

    moni wrote:

    > Hi,
    >
    > I was trying to fetch the number of unread email messages in my yahoo/
    > gmail inbox by using the Javamail, and JavaBeans Activation Framework
    > by using the link
    >
    > http://timarcher.com/?q=node/52
    >
    > where I was putting
    >
    > POP3 pop3 = new POP3("yahoo.com", "manavi.monisha", "password");
    >
    >


    Is there an actual host called yahoo.com, and does it listen on the POP3 port of
    110? I would doubt it. More than likely if such a generic host does exist it is
    an HTTP load balancing system listening on port 80 and re-directing requests to
    a battery of real web servers.

    I think you need to find exactly which host on the yahoo domain is their POP
    server and use that as the hostname. Perhaps pop.mail.yahoo.com is what you
    need?

    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
    Nigel Wade, Sep 28, 2007
    #4
  5. moni

    moni Guest

    Hi,

    I did try using pop.mail.yahoo.com, instead. But it still dosent work.
    Maybe I should add it in the properties of store.connect(??) and
    Properties ??? I actually also tried that..it still dosent work. Maybe
    i have the wrong parameters in there? Any clue?

    Thanx..

    Moni

    On Sep 28, 8:16 am, Nigel Wade <> wrote:
    > moni wrote:
    > > Hi,

    >
    > > I was trying to fetch the number of unread email messages in my yahoo/
    > > gmail inbox by using the Javamail, and JavaBeans Activation Framework
    > > by using the link

    >
    > >http://timarcher.com/?q=node/52

    >
    > > where I was putting

    >
    > > POP3 pop3 = new POP3("yahoo.com", "manavi.monisha", "password");

    >
    > Is there an actual host called yahoo.com, and does it listen on the POP3 port of
    > 110? I would doubt it. More than likely if such a generic host does exist it is
    > an HTTP load balancing system listening on port 80 and re-directing requests to
    > a battery of real web servers.
    >
    > I think you need to find exactly which host on the yahoo domain is their POP
    > server and use that as the hostname. Perhaps pop.mail.yahoo.com is what you
    > need?
    >
    > --
    > Nigel Wade, System Administrator, Space Plasma Physics Group,
    > University of Leicester, Leicester, LE1 7RH, UK
    > E-mail :
    > Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
    moni, Sep 29, 2007
    #5
  6. moni

    Nigel Wade Guest

    moni wrote:

    > Hi,
    >
    > I did try using pop.mail.yahoo.com, instead. But it still dosent work.


    In what way did it fail? "It doesn't work" tells us nothing useful. Can you
    connect to their POP3 server from a command shell using telnet? That is the
    first level diagnostic to perform, to check that you have the necessary
    networking setup.

    Open a command shell and type:

    telnet pop.mail.yahoo.com 110

    If your networking is setup correctly you should get a prompt back from Yahoo
    POP3 server:
    Trying 206.190.53.11...
    Connected to pop.mail.yahoo.com (206.190.53.11).
    Escape character is '^]'.
    +OK hello from popgate on pop107.plus.mail.re2.yahoo.com 2.38.1

    If you don't get a response there is likely something wrong with your networking
    setup. If telnet can't connect then it's unlikely Java will be able to.

    > Maybe I should add it in the properties of store.connect(??)


    What is store.connect()?


    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
    Nigel Wade, Oct 1, 2007
    #6
  7. moni

    Roedy Green Guest

    >I did try using pop.mail.yahoo.com, instead.
    >But it still doesn't work.

    I would try some smaller mail server for debugging. It less likely to
    have peculiar properties. I would leave Gmail, Yahoo, and AOL until
    you have the code working elsewhere. They are all primarily web mail,
    and might not even support POP3.
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Oct 2, 2007
    #7
  8. [posted and mailed]

    moni <> wrote in news:1191021570.799674.179080
    @d55g2000hsg.googlegroups.com:

    > I did try using pop.mail.yahoo.com, instead. But it still dosent work.


    I'd suggest reading the documentation for JavaMail and setting the system
    property "mail.debug" as detailed in the documentation, as discussed in the
    javadoc for Javamail.

    I would also suggest reading the documentation for Yahoo Mail, particularly
    <http://mailplus.mail.yahoo.com/>, which indicates that POP3 access is not
    available for free, standard Yahoo mail accounts but is available for the
    $19.95 / year upgraded Yahoo Mail service.

    If you're still having problems, please post:

    1. a _complete_, correct and compilable test program that demonstrates the
    problem (username and password obscured, of course).

    2. a fuller description of the problem that you're having than "it don't
    work".

    3. output sent to System.out from running the program in step #1 with
    mail.debug set as described in the javadoc.


    Cheers!
    GRB

    --
    ---------------------------------------------------------------------
    Greg R. Broderick

    A. Top posters.
    Q. What is the most annoying thing on Usenet?
    ---------------------------------------------------------------------
    Greg R. Broderick, Oct 6, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Albisser
    Replies:
    1
    Views:
    1,073
    GaryM
    Apr 7, 2004
  2. Vijay
    Replies:
    1
    Views:
    645
    Daniel
    May 13, 2005
  3. Charter
    Replies:
    2
    Views:
    37,304
    Roedy Green
    Sep 20, 2005
  4. Nikhil
    Replies:
    4
    Views:
    973
    Martin Gregorie
    Apr 15, 2007
  5. Deepa Rajendran
    Replies:
    0
    Views:
    131
    Deepa Rajendran
    Feb 23, 2009
Loading...

Share This Page