title: is starttls.enabled = true is safe for mail sending from java code?
body: <p>I'm sending emails from java code.My configuration is</p>
  
  <pre><code> props.put("mail.smtp.starttls.enable", "true");
   props.put("mail.smtp.host", "****"); 
   props.put("mail.smtp.auth", "true");
   props.put("mail.smtp.port", "587");
  </code></pre>
  
  <p>On my <a href="https://stackoverflow.com/questions/18311294/is-starttlssmtp-the-same-with-smtp-over-ssl">other question</a> <a href="https://stackoverflow.com/users/207421/ejp">EJP</a> answered </p>
  
  <blockquote>
    <p>Any protocol that uses STARTTLS is in SSL mode after the STARTTLS
    command is issued</p>
  </blockquote>
  
  <p>But my debug output shows:DEBUG SMTP: trying to connect to host "****", port 587, isSSL false. </p>
  
  <p>So my question sounds like</p>
  
  <p>Is such configuration really safe and uses <code>SSL</code> as <a href="https://stackoverflow.com/users/207421/ejp">EJP</a> said despite of isSSL=false on my debug output?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>connecting code</p>
  
  <pre><code> Transport transport = session.getTransport("smtp");
   transport.connect("host", 587,"username", "password");
  </code></pre>
  
  <p>when I wrote   <code>Transport transport = session.getTransport("smtps")</code> I got</p>
  
  <pre><code>javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection
  </code></pre>