• Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaMail Question

 
ravinderSingh singh
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

When specifying Javamail properties when obtaining a session, e.g:

Properties p = new Properties();
p.put("mail.store.protocol", "imap");

Session.getInstance(p, null);

... is it possible to specify a username and password in the properties object when the mail server requires authentication, e.g.

Properties p = new Properties();
p.put("mail.store.protocol", "imap");
p.put("username", "my_username");
p.put("password", "my_password");

Session.getInstance(p, null);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!