title: How to make smtp setting when send email with SwiftMailer (ssl is already enabled)
body: <p>I want to send email with swiftMailer via php with my gmail. The ssl is already set but it still doesn't work. </p>
  
  <p>Here is my smtp settings in the php:</p>
  
  <pre><code>$transport = 
      Swift_SmtpTransport::newInstance('smtp.gmail.com',465,"ssl")
      -&gt;setUsername('mygmail@gmail.com')
      -&gt;setPassword('mygmailpassword');
  
  $mailer = Swift_Mailer::newInstance($transport);
      $message = Swift_Message::newInstance();
      $message -&gt;setSubject('Welcome to ++');
      $message -&gt;setFrom(array('myemail@gmail.com' =&gt; 'websitename'));
      $message -&gt;setTo(array($info['email'] =&gt; $info['username']));
  </code></pre>
  
  <p>Here are the settings in the php.ini</p>
  
  <pre><code>Edit php.ini and uncomment extension_dir=ext.
  Also uncomment extension=php_openssl.dll.
  </code></pre>
  
  <p>Here are the warnings:</p>
  
  <p>Warning: fsockopen(): in C:...\StreamBuffer.php on line 243
  Fatal error: Uncaught exception 'Swift_TransportException' with message in C:...\StreamBuffer.php on line 245
  Swift_TransportException: in C:...\StreamBuffer.php on line 245</p>
  
  <p>Here is the code between line 243 and 249:</p>
  
  <pre><code>if (!$this-&gt;_stream = fsockopen($host, $this-&gt;_params['port'], $errno, $errstr, $timeout))
      {
        throw new Swift_TransportException(
          'Connection could not be established with host ' . $this-&gt;_params['host'] .
          ' [' . $errstr . ' #' . $errno . ']'
          );
      }
  </code></pre>
  
  <p>Thanks!</p>