我正在为我的 Web 应用程序使用 codeigniter,并且我使用 codeigniter 的电子邮件功能来发送电子邮件。但是当我尝试发送电子邮件时出现以下错误。
找不到套接字传输“ssl” - 您是否在配置 PHP 时忘记启用它
这是我用来获得功能的代码。
$config['protocol'] = "smtp";
$config['smtp_host'] = "ssl://smtp.googlemail.com";
$config['smtp_port'] = 465;
$config['smtp_user'] = "xxxx@gmail.com";
$config['smtp_pass'] = "xxxxxx";
$this->load->library('email');
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->from('xxxx@gmail.com','Sample');
$this->email->to('xxxxx@gmail.com');
$this->email->subject('temperary Email');
$this->email->message('This is a sample message');
if ($this->email->send()) {
echo 'Your email was sent, dude.';
} else {
show_error($this->email->print_debugger());
}
这有什么问题?
谢谢..