title: Cannot figure out the IMAP mailServer for gmail
body: <p>I'm making an application on android that retrieves emails from gmail accounts using JavaMail API.
  Here's my code:</p>
  
  <pre><code>    Properties props = new Properties();
      props.setProperty("mail.store.protocol", "imaps");
      props.setProperty("mail.imaps.host", mailServer);
      props.setProperty("mail.imaps.port", "993");
      props.setProperty("mail.imaps.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
      props.setProperty("mail.imaps.socketFactory.fallback", "false");
      if (debug) Log.i("check","before session");
      Session imapSession = Session.getDefaultInstance(props,null);
      if (debug) Log.i("check","after session");
  </code></pre>
  
  <p>Whenever the code reaches the imapSession line, the application just crashes. In other words, it never reaches the last line.
  I've tried several mailServer strings:</p>
  
  <pre><code>imaps.gmail.com
  imap.gmail.com
  imaps.googlemail.com
  imap.googlemail.com
  </code></pre>
  
  <p>and nothing seems to work. Is it the port?
  I'm sure I've added the right permissions, the error in the log cat doesn't mention the permissions anyways.</p>
  
  <p><strong>Another question</strong> where can I get such information for Gmail and other email servers?</p>