【发布时间】:2013-12-10 16:27:09
【问题描述】:
我尝试从我的系统发送电子邮件,但收到此错误消息。
Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
我已经看到其他类似的帖子,但无法解决我的问题。我试图将我的代码从“ssl”更改为“tls”,但出现另一个错误。因为我将我的项目上传到大学服务器,所以我无法对服务器配置做任何事情。这是我到目前为止的代码:
$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);
【问题讨论】:
标签: php zend-framework ssl sendmail