我正在尝试从我的localhost向用户发送有关他们忘记密码的电子邮件 . (测试)此功能在我的控制器中
// Send Request Email
public function send_email()
{
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '***@gmail.com', // change it to yours
'smtp_pass' => '***', // change it to yours
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$message = '';
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('***@gmail.com', "Mama");
$this->email->to('***@gmail.com');
$this->email->subject('Mama Needs You');
$this->email->message($message);
if($this->email->send())
{
echo 'Email sent to Mama.';
}
else
{
show_error($this->email->print_debugger());
}
}
一旦用户输入他的电子邮件并单击请求按钮,AJAX调用将请求上面的函数(send_email) . 但回答是这样的
A PHP Error was encountered
严重性:警告消息:fsockopen():SSL操作失败,代码为1. OpenSSL错误消息:错误:14090086:SSL例程:ssl3_get_server_certificate:证书验证失败文件名:libraries / Email.php行号:2055 Backtrace:文件:D: \ xampp \ htdocs \ prototype \ application \ controllers \ Manage.php行:191函数:发送文件:D:\ xampp \ htdocs \ prototype \ index.php行:315函数:require_once遇到PHP错误严重性:警告消息: fsockopen():无法启用加密文件名:libraries / Email.php行号:2055 Backtrace:文件:D:\ xampp \ htdocs \ prototype \ application \ controllers \ Manage.php行:191功能:发送文件:D:\ xampp \ htdocs \ prototype \ index.php行:315函数:require_once遇到PHP错误严重性:警告消息:fsockopen():无法连接到ssl://smtp.googlemail.com:465(未知错误)文件名: libraries / Email.php行号:2055 Backtrace:文件:D:\ xampp \ htdocs \ prototype \ application \ controllers \ Manage.php行:191 Fun ction:发送文件:D:\ xampp \ htdocs \ prototype \ index.php行:315功能:require_once
1 回答
**试试这个 **