title: JavaMail Gmail ConnectionTimeOut
body: <p>I have this code and when i try to connect to Gmail, I am getting connection time out exception</p>
  
  <pre><code>    Properties props = System.getProperties();
      props.setProperty("mail.store.protocol", "imaps");
      try {
              Session session = Session.getDefaultInstance(props, null);
              Store store = session.getStore("imaps");
  
              store.connect("imap.gmail.com", "my.email.id", "eightasteriks");
  </code></pre>
  
  <p>P.S:</p>
  
  <ul>
  <li>I copied this code from Stackover flow thread.</li>
  <li>All the necessary libraries have been imported</li>
  </ul>