protected static void checkCreateSession ( ) { if ( _defaultSession == null ) { // no need to sync Properties props = System . getProperties ( ) ; if ( props . getProperty ( "mail.smtp.host" ) == null ) { props . put ( "mail.smtp.host" , "localhost" ) ; } _defaultSession = Session . getDefaultInstance ( props , null ) ; } }
Create our default session if not already created .