public void connect() 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));
  if (TYPE_IMAP == getType())   properties.put("mail.imap.partialfetch","false");
  _fldtry=username != null ? Session.getInstance(properties,new _Authenticator(username,password)) : Session.getInstance(properties);
  _fldelse=_fldtry.getStore(type);
  if (!StringUtil.isEmpty(username))   _fldelse.connect(server,username,password);
 else   _fldelse.connect();
}

public void connect ( ) 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 ) ) ; if ( TYPE_IMAP == getType ( ) ) properties . put ( "mail.imap.partialfetch" , "false" ) ; _fldtry = username != null ? Session . getInstance ( properties , new _Authenticator ( username , password ) ) : Session . getInstance ( properties ) ; _fldelse = _fldtry . getStore ( type ) ; if ( ! StringUtil . isEmpty ( username ) ) _fldelse . connect ( server , username , password ) ; else _fldelse . connect ( ) ; }
connects to pop server
