问题
i tried to sent email from my system but got this error messages.
Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
i already see the others similar post but can't resolve my problem. i tried to change my code from "ssl" to "tls' but get1 the another error. Since i upload my project into University server, so i can't do anything with server configuration. This is my code so far :
$config = array('ssl' => 'ssl',
'auth' => 'login',
'username' => 'somename@gmail.com',
'password' => 'password');
$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
$email = 'somename1@gmail.com';
$username = 'John';
$mail = new Zend_Mail();
$mail->setBodyHtml("sdsd");
$mail->setFrom('somename@gmail.com');
$mail->addTo($email, $username);
$mail->setSubject('Profile Activation');
$mail->send($transport);
回答1:
OpenSSL support isn't enabled on your web server. You can use phpinfo()
to see what extensions your PHP installation supports. If OpenSSL isn't one of them you're out of luck using SSL or TLS.
回答2:
as suggested openSSL is Not enable in your php..
Open php.ini
uncomment the following:
extension=php_openssl.dll
then restart the server..
Hope this helps, also you can use this http://www.php.net/manual/en/openssl.installation.php
来源:https://stackoverflow.com/questions/20499810/unable-to-find-the-socket-transport-ssl-in-zend-framework-1-12