title: Symfony and SwiftMailer sending with starttls
body: <p>Can someone explain to me how work SSL AND STARTTLS with PHP ?</p>
  
  <p>Il have a dedicated server with Postfix and Dovecot (managed by plesk). I don't have SSL.</p>
  
  <p>To get and send my emails, I use SMTP/IMAP with STARTTLS.</p>
  
  <p>But in PHP, with Swiftmailer and Symfony, I only have two options : ssl or tls. 
  None of the 2 work in my case, emails do not leave.</p>
  
  <p>Searching on stackoverflow, I put this in my code and this working : </p>
  
  <pre><code>$transport = \Swift_SmtpTransport::newInstance('smtp.server.fr', 587, 'tls')
  -&gt;setUsername($username)
  -&gt;setPassword($password)
  -&gt;setStreamOptions(array('ssl' =&gt; array(
      'verify_peer' =&gt; false,
      'verify_peer_name' =&gt; false,
      'allow_self_signed' =&gt; true
   )));
  
  $mailer = \Swift_Mailer::newInstance($transport);
  </code></pre>
  
  <p>Do you think my configuration is correct?</p>