title: Error sending email with gmail
body: <p>I have the following code:</p>
  
  <pre><code> Email email = new SimpleEmail();
      email.setHostName("smtp.googlemail.com");
      email.setSmtpPort(465);
      email.setAuthenticator(new DefaultAuthenticator("ruth.sistem@gmail.com", "XXXXXX"));
      email.setSSLOnConnect(true);
      email.setFrom("ruth.sistem@gmail.com");
      email.setSubject("TestMail");
      email.setMsg("This is a test mail ... :-)");
      email.addTo("ruth.sistem@gmail.com");
      email.send();
  </code></pre>
  
  <p>I can not connect to gmail, an error burst with connection appears, however all connection information are correct, do not know what is blocking the connection from my code for sending the email, I can not send a simple email and I do not slightest idea what it is.</p>
  
  <pre><code> org.apache.commons.mail.EmailException: Sending the email to the following server failed :                                                          smtp.googlemail.com:465
  at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1410)
  at org.apache.commons.mail.Email.send(Email.java:1437)
  at com.observatorioLegislativo.util.EmailTeste.enviaEmailSimples(EmailTeste.java:27)
  at com.observatorioLegislativo.util.EmailTeste.&lt;init&gt;(EmailTeste.java:13)
  at com.observatorioLegislativo.bean.Teste.main(Teste.java:41)
  Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.googlemail.com,  port: 465;
   nested exception is:
  java.net.ConnectException: Connection timed out: connect
  at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1972)
  at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:642)
  at javax.mail.Service.connect(Service.java:317)
  at javax.mail.Service.connect(Service.java:176)
  at javax.mail.Service.connect(Service.java:125)
  at javax.mail.Transport.send0(Transport.java:194)
  at javax.mail.Transport.send(Transport.java:124)
  at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1400)
  ... 4 more
  
  
  Caused by: java.net.ConnectException: Connection timed out: connect
  at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
  at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
  at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
  at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
  at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
  at java.net.PlainSocketImpl.connect(Unknown Source)
  at java.net.SocksSocketImpl.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
  at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:317)
  at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:207)
  at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1938)
  ... 11 more
  </code></pre>
  
  <p>appreciate the help</p>