1.

What Is Session In Javamail Api?

Answer»

Session is the top-level entry CLASS representing mail session. It USES java.util.Properties object to get information about mail server, username, password etc. This class has a private constructor and you can get session OBJECTS through getInstance() and getDefaultInstance() METHODS. getDefaultInstance() method PROVIDES default Session object which takes Properties and Authenticator objects as arguments.

Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
Or create a unique session by getInstance() method…

Properties props = new Properties();
Session session = Session.getInstance(props, null);

Session is the top-level entry class representing mail session. It uses java.util.Properties object to get information about mail server, username, password etc. This class has a private constructor and you can get session objects through getInstance() and getDefaultInstance() methods. getDefaultInstance() method provides default Session object which takes Properties and Authenticator objects as arguments.

Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
Or create a unique session by getInstance() method…

Properties props = new Properties();
Session session = Session.getInstance(props, null);



Discussion

No Comment Found