title: Swift mailer triggers fatal error;
body: <blockquote>
    <p>Fatal error: Uncaught exception 'Swift_TransportException' with
    message 'Expected response code 250 but got code "530", with message
    "530 5.7.0 Must issue a STARTTLS command first. fb9sm57232081wid.2 -
    gsmtp "' in
    C:\xampp\htdocs\lib\classes\Swift\Transport\AbstractSmtpTransport.php:386
    Stack trace: #0
    C:\xampp\htdocs\lib\classes\Swift\Transport\AbstractSmtpTransport.php(281):
    Swift_Transport_AbstractSmtpTransport->_assertResponseCode('530 5.7.0
    Must ...', Array) #1
    C:\xampp\htdocs\lib\classes\Swift\Transport\EsmtpTransport.php(245):
    Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM:
    executeCommand('MAIL FROM: _doMailFromCommand('sophie3394@gm...')</p>
    
    <h1>4 C:\xampp\htdocs\lib\classes\Swift\Transport\AbstractSmtpTransport.php(444):</h1>
    
    <p>Swift_Transport_AbstractSmt in
    C:\xampp\htdocs\lib\classes\Swift\Transport\AbstractSmtpTransport.php
    on line 386</p>
  </blockquote>
  
  <p>This is the error caused by the following code: </p>
  
  <pre><code>ini_set("SMTP","ssl://smtp.gmail.com");
  ini_set("smtp_port","465");
  
  require_once 'lib/swift_required.php';
  
  $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 25)
      -&gt;setUsername('sophie3394@gmail.com')
      -&gt;setPassword('xxxx');
  
  $mailer = Swift_Mailer::newInstance($transport);
  
  $message = Swift_Message::newInstance('Test Subject')
      -&gt;setFrom(array('sophie3394@gmail.com' =&gt; 'ABC'))
      -&gt;setTo(array('sophie3394@gmail.com'))
      -&gt;setBody('This is a test mail.');
  
  $result = $mailer-&gt;send($message);
  </code></pre>
  
  <p>What are the steps to resolve this error?</p>
  
  <hr>
  
  <blockquote>
    <p>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? #1899472503]' in
    C:\xampp\htdocs\lib\classes\Swift\Transport\StreamBuffer.php:259 Stack
    trace: #0
    C:\xampp\htdocs\lib\classes\Swift\Transport\StreamBuffer.php(64):
    Swift_Transport_StreamBuffer->_establishSocketConnection() #1
    C:\xampp\htdocs\lib\classes\Swift\Transport\AbstractSmtpTransport.php(115):
    Swift_Transport_StreamBuffer->initialize(Array) #2
    C:\xampp\htdocs\lib\classes\Swift\Mailer.php(80):
    Swift_Transport_AbstractSmtpTransport->start() #3
    C:\xampp\htdocs\Mail.php(26):
    Swift_Mailer->send(Object(Swift_Message)) #4 {main} thrown in
    C:\xampp\htdocs\lib\classes\Swift\Transport\StreamBuffer.php on line
    259</p>
  </blockquote>