Look up a JavaMail session with JNDI

 

Lookup a JavaMail resource. The actual lookup name is determined by the application's deployment descriptors.

 

Usage scenario

// Get the initial context as shown above
...
Session session =
     (Session) initialContext.lookup("java:comp/env/mail/MailSession");