title: How to fix "could not open socket in Zend Mail (Zend Framework 2)
body: <p>Please help me fix problem on Mac OS, when I type on my windows, It works.
  I try on my mac, it shows "could not open socket".
  Everybody could help me.</p>
  
  <pre><code>public function indexAction(){
      $mail = new Mail\Message;
                  $mail-&gt;setFrom('paradise.losebaby@gmail.com','Flyoverfly Training');
                  $mail-&gt;addTo('thanhbvh@yahoo.com.vn','maithanh');
                  $mail-&gt;setSubject('Xác nhận việc phục hồi mật khẩu');
                  $mail-&gt;setBody('maithanh');
  
                  $transport = new SmtpTransport;
                  $option = new SmtpOptions(array(
                      'name' =&gt; 'smtp.gmail.com',
                      'host' =&gt; 'smtp.gmail.com',
                      'port' =&gt; 465,
                      'connection_class' =&gt; 'login',
                      'connection_config' =&gt; array(
                          'username' =&gt; 'myemail@gmail.com',
                          'password' =&gt; 'mypass',
                          'ssl' =&gt; 'ssl'
                      )
                  ));
                  $transport-&gt;setOptions($option);
                  $transport-&gt;send($mail);
      return new ViewModel;
  }
  </code></pre>