Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MessagingException: Connect failed

 
Ashish Agre
Ranch Hand
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ashish Agre
Ranch Hand
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See
use host = "pop.gmail.com";
Store store = session.getStore("pop3s");
thanks all for JavaMail- FAQ .........
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic