title: What does :tls => true do in SMTP settings in Rails 5?
body: <p>I'm using Sendgrid on a Rails 5.2 application and was getting a
  <code>Net::ReadTimeout</code> error when trying to send an email. The post here
  <a href="https://github.com/mikel/mail/issues/639#issuecomment-29016055" rel="nofollow noreferrer">https://github.com/mikel/mail/issues/639#issuecomment-29016055</a> suggested adding <code>:tls =&gt; true</code> to the SMTP settings. That worked, but it seems like an old solution and I'd like to understand what it's doing and why it worked.</p>
  
  <p>This is my SMTP setup that gave the <code>Net::ReadTimeout</code> error:</p>
  
  <pre><code>ActionMailer::Base.smtp_settings = {
    :user_name =&gt; 'username',
    :password =&gt; 'password',
    :domain =&gt; 'mydomain.com',
    :address =&gt; 'smtp.sendgrid.net',
    :port =&gt; 465,
    :authentication =&gt; :plain,
    :enable_starttls_auto =&gt; true
  }
  </code></pre>
  
  <p>This is the update that's working.</p>
  
  <pre><code>ActionMailer::Base.smtp_settings = {
    :user_name =&gt; 'username',
    :password =&gt; 'password',
    :domain =&gt; 'mydomain.com',
    :address =&gt; 'smtp.sendgrid.net',
    :port =&gt; 465,
    :authentication =&gt; :plain,
    :enable_starttls_auto =&gt; true,
    # this line added
    :tls =&gt; true
  }
  </code></pre>