title: "Sending the email to the following server failed : webmail.company.com:465"
body: <p>I use this code to send email </p>
  
  <pre><code> Email email = new SimpleEmail();
              email.setDebug(true);
              email.setHostName("webmail.company.com");
              email.setSmtpPort(587);
  
              email.setAuthenticator(new DefaultAuthenticator("username@company.com", "*****"));
              email.setSSLOnConnect(true);
              try {
                  email.setFrom("username@company.com");
  
                  email.setSubject("TestMail");
  
                  email.setMsg("Hi "+receiver.getSex()+" "+receiver.getName()+" "+editorBean.getValue());
  
                  email.addTo(receiver.getEmail());
                  email.send();
              } catch (EmailException ex) {
                  Logger.getLogger(PersonBean.class.getName()).log(Level.SEVERE, null, ex);
                  result += "exptions :" + ex.getMessage();
                  return result;
              }
  </code></pre>
  
  <p>and I think that smtp port is not changing 
  "Sending the email to the following server failed : webmail.company.com:465"
  what is the problem ? </p>