Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

store.connect() problem  RSS feed

ved gunjan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all!
I'm programming a mail server. As we know the server listen at port 25 for smtp, and port 110 for IMAP. When connection established, a new socket is create for communication.

But im getting the following error when making the connection.

javax.mail.MessagingException: Connection refused; nested exception is: Connection refused

I've set the following session propeties
The parameters are:

what value i should give to the connect()method.
How do we set the password field of the connect()method cause there is nothing like mail.password

My code looks like this..
public class MailRetriver
string mail_host="localhost";
string mail_user="";
string password=""
//JNDI look up for the session

Store store = session.getStore();
store.connect(mail_host, mail_user, password);
Folder folder = store.getDefaultFolder().getFolder("INBOX");



My question is what value should i give in the connect() method.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!