Error using POP3 to fetch email using Javamail

M

moni

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...
 
P

priytosh_ppu2

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
 
N

Nigel Wade

moni said:
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?
 
M

moni

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
 
N

Nigel Wade

moni said:
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()?
 
R

Roedy Green

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.
 
G

Greg R. Broderick

[posted and mailed]

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 (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top