title: Sending email using php, gmail, and swiftmailer causes SSL-related error
body: <p>Here is my PHP code:</p>
  
  <pre><code>function SendCookieToTheMail()
  {
      require_once 'swift-mailer/lib/swift_required.php';
      //Create the Transport
      $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com')
        -&gt;setPort(465)
        -&gt;setEncryption('ssl')
        -&gt;setUsername('007@gmail.com')
        -&gt;setPassword('123')
        ;
  
      //Create the Mailer using your created Transport
      $mailer = Swift_Mailer::newInstance($transport);
  
      //Create a message
      $message = Swift_Message::newInstance('Test')
        -&gt;setFrom(array('007@gmail.com' =&gt; 'From mr. 007'))
        -&gt;setTo(array('007@gmail.com', '007@gmail.com' =&gt; 'To mr. 007'))
        -&gt;setBody('Body')
        ;
  
      //Send the message
      $result = $mailer-&gt;send($message);
  
      /*
      You can alternatively use batchSend() to send the message
  
      $result = $mailer-&gt;batchSend($message);
      */ 
  }
  </code></pre>
  
  <p>Here is the error:</p>
  
  <p><code>( ! ) Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in C:\Program Files\wamp\www\swift-mailer\lib\classes\Swift\Transport\StreamBuffer.php on line 233</code></p>
  
  <p><code>( ! ) Fatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host smtp.gmail.com [Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? #44551400]' in C:\Program Files\wamp\www\swift-mailer\lib\classes\Swift\Transport\StreamBuffer.php on line 235</code></p>
  
  <p><code>( ! ) Swift_TransportException: Connection could not be established with host smtp.gmail.com [Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? #44551400] in C:\Program Files\wamp\www\swift-mailer\lib\classes\Swift\Transport\StreamBuffer.php on line 235</code></p>
  
  <p>Where is the problem??</p>
  
  <h2>Update:</h2>
  
  <p>I checked <code>phpinfo()</code> and it says:</p>
  
  <pre><code>OpenSSL support     disabled (install ext/openssl) 
  </code></pre>
  
  <p>I referred to the links below, but I couldn't install ssl...</p>