$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
'smtp_port' => '465',
'smtp_user' => "xxxxxxx@gmail.com",
'smtp_pass' => "xxxxxxx", // change it to yours
'mailtype' => 'html',
'charset' => 'utf8'
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
$this->email->set_crlf( "\r\n" );
$this->email->from($config['smtp_user']);
$this->email->to($email['user_email']);
$this->email->subject($row['tplsubject']);
$this->email->message(html_entity_decode($email_subject));
$this->email->send();
Run Code Online (Sandbox Code Playgroud)
此代码无法显示错误
遇到PHP错误
严重性:警告
消息:fsockopen():无法连接到ssl://smtp.gmail.com:465(无法找到套接字传输"ssl" - 您是否忘记在配置PHP时启用它?)
文件名:libraries/Email.php
行号:1689
codeigniter ×1