public void start ( ) throws MessagingException { Properties properties = new Properties ( ) ; String type = getTypeAsString ( ) ; properties . put ( "mail." + type + ".host" , server ) ; properties . put ( "mail." + type + ".port" , new Double ( port ) ) ; properties . put ( "mail." + type + ".connectiontimeout" , String . valueOf ( timeout ) ) ; properties . put ( "mail." + type + ".timeout" , String . valueOf ( timeout ) ) ; // properties.put("mail.mime.charset", "UTF-8"); if ( secure ) { properties . put ( "mail." + type + ".ssl.enable" , "true" ) ; // properties.put("mail."+type+".starttls.enable", "true" ); } if ( TYPE_IMAP == getType ( ) ) { properties . put ( "mail.imap.partialfetch" , "false" ) ; } // if(TYPE_POP3==getType()){} _session = username != null ? Session . getInstance ( properties , new _Authenticator ( username , password ) ) : Session . getInstance ( properties ) ; _store = _session . getStore ( type ) ; if ( ! StringUtil . isEmpty ( username ) ) _store . connect ( server , username , password ) ; else _store . connect ( ) ; }
connects to pop server