Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2007

Tip: Looking for answers? Try searching our database.

Error using POP3 to fetch email using Javamail

Thread view: 
moni - 27 Sep 2007 22:30 GMT
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...
priytosh_ppu2@yahoo.com - 27 Sep 2007 22:34 GMT
> Hi,
>
[quoted text clipped - 26 lines]
>
> Thanx...

hi friends i m priytosh kumr from india
Roedy Green - 28 Sep 2007 00:22 GMT
>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
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Nigel Wade - 28 Sep 2007 13:16 GMT
> Hi,
>
[quoted text clipped - 7 lines]
>
> 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?

Signature

Nigel Wade, System Administrator, Space Plasma Physics Group,
           University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555

moni - 29 Sep 2007 00:19 GMT
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

> > Hi,
>
[quoted text clipped - 22 lines]
> E-mail :    n...@ion.le.ac.uk
> Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555
Nigel Wade - 01 Oct 2007 10:21 GMT
> 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()?

Signature

Nigel Wade, System Administrator, Space Plasma Physics Group,
           University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555

Roedy Green - 02 Oct 2007 00:06 GMT
>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.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Greg R. Broderick - 06 Oct 2007 17:33 GMT
[posted and mailed]

moni <mons.2110@gmail.com> 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

Signature

---------------------------------------------------------------------
Greg R. Broderick                  usenet200709@blackholio.dyndns.org

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.