嘿任何人都可以帮助我摆脱这个问题,我收到以下错误遇到 PHP 错误
Severity: Warning
Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.googlemail.com:587 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)
Filename: libraries/Email.php
Line Number: 1689
A PHP Error was encountered
Severity: Warning
Message: fwrite() expects parameter 1 to be resource, boolean given
Filename: libraries/Email.php
Line Number: 1846
我的电子邮件类中有以下代码
Class MailSender extends CI_Model{
function __construct(){
parent::__construct();
}
public function sendMail(){
$config=array(
'protocol'=>'smtp',
'smtp_host'=> 'ssl://smtp.googlemail.com',
'smtp_port' => 587,
'smtp_user' => 'bhatta.bj@gmail.com',
'smtp_pass' => 'signature08'
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
$this->email->from("bhatta.bj@gmail.com");
$this->email->to("curtains_v@hotmail.com");
$this->email->subject("this is a sample mail");
$this->email->message("this is a sample message please check this");
if($this->email->send()){
//$data['message']="Email sent successfully";
return true;
}else{
//$data['message']="Couldnt sent the email, please provide me valid email address";
return false;
}
}
}