title: javax.mail.messagingexception connection timed out connect
body: <p>Below code is the part of the web application. This is responsible to connect with outlook mail server.   </p>
  
  <pre><code>    ls_user_pass = ldch_sys_users.getItemValue(1, "user_password").toString();      
  
      Store store = null;     
      String lstr_host = "",lstr_result= "no";
          HttpSession lssessionUserAuth = (HttpSession) ahm_args.get("session");  
          try {               
  
                  Properties properties = new Properties();
                  properties.setProperty("mail.store.protocol", "imaps");
                  Session session = Session.getInstance(properties, null);                                
                  lstr_host = "outlook.office365.com";                    
                  store = session.getStore("imaps");
                  store.connect(lstr_host, "rajesh___@outlook.com", ls_user_pass);
                  if (store.isConnected()) {
                  lstr_result = "yes";
                  }               
          }catch(AuthenticationFailedException e){
  
          }
          return lstr_result;
  }
  </code></pre>
  
  <p>when I deployed war on server , I am getting this error javax.mail.messagingexception connection timed out connect. 
  Already I have opened few port 587,143,25 and on server firewall is off.</p>
  
  <p>But when I work through eclipse on local system, it working fine, without any problem.</p>