This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other JSE/JEE APIs and the fly likes MessagingException: Connect failed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "MessagingException: Connect failed" Watch "MessagingException: Connect failed" New topic
Author

MessagingException: Connect failed

Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73



| B.E IT | SCJP 6.0 98 % |
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4530
    
    5

Ashish, we don'thave too many rules around here, but we do ask that you BeForthrightWhenCrossPostingToOtherSites

http://forums.oracle.com/forums/thread.jspa?threadID=2250539


luck, db
There are no new questions, but there may be new answers.
Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

JavaMail posted question in another forum but yet to receive any answer, can anybody please help me out here.....
As this is only cmd-line code i have to built it in Servlet/Jsp for My Mail-Client Project........
What is the problem with the code? can any one rectify it?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Why do you insist on asking about the code?

The message says "Connect failed". So your code tries to connect to a server on a particular computer which is supposed to be listening at a particular port. What happens if there is no such server listening? No amount of fiddling with your code is going to fix that.

So remember, real code runs in an environment. The code has to be right, and the environment has to be right too. It's not just about the code.
Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

Consider gmail :
host = "209.85.153.83" //mail.google.com
uname = "myuname"
passwd = "mypasswd"



i just need to connect once to server then step by step i'll proceed
@ Paul mail.google.com is listening and we know there exists such SERVER, please kindly provide further solution...
Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

This is i read from James Holmes small Article in BOOK
POP3
Post Office Protocol version 3 (POP3) is the dominant protocol for retrieving e-mail from
e-mail servers on the Internet. POP3 is very basic, allowing e-mail clients to access only
mail in a default “Inbox” folder.
IMAP
Internet Message Access Protocol (IMAP) is another protocol for retrieving e-mail from
e-mail servers on the Internet. IMAP has more features than POP and supports retrieving
messages from multiple accounts and folders. IMAP also supports the use of public folders
where messages are shared.

Kindly concentrate on getting rid off the problem instead other issues...
Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

Paul Clapham wrote:Why do you insist on asking about the code?
So remember, real code runs in an environment. The code has to be right, and the environment has to be right too. It's not just about the code.
Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

See
use host = "pop.gmail.com";
Store store = session.getStore("pop3s");
thanks all for JavaMail- FAQ .........
 
 
subject: MessagingException: Connect failed