$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
'smtp_port' => '465',
'smtp_user' => "[email protected]",
'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();
此代碼不能正常工作的示值誤差的fsockopen():無法連接到SSL://smtp.gmail.com:465
遇到一個PHP錯誤
嚴重性:警告
消息:的fsockopen():無法連接到SSL://smtp.gmail.com:465 (找不到插座運輸 「SSL」 - 你忘記啓用 它,當你配置PHP?)
文件名:庫/ Email.php
行號:1689
PROTIP:不要在問題中包含* real *密碼。 –
我只是需要這個測試,所以我從'ssl://smtp.gmail.com'中刪除了'ssl://'並且能夠繼續測試。 – busycoding