I am trying to send an email from my localhost to user regarding for their forgotten password. (Test) This function is in my controller
// 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());
}
}
Once the user enter his email and click the request button, the function above (send_email) will be requested by AJAX call. But the reply is this
A PHP Error was encountered
Severity: Warning
Message: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Filename: libraries/Email.php
Line Number: 2055
Backtrace:
File: D:\xampp\htdocs\prototype\application\controllers\Manage.php Line: 191 Function: send
File: D:\xampp\htdocs\prototype\index.php Line: 315 Function: require_once
A PHP Error was encountered Severity: Warning
Message: fsockopen(): Failed to enable crypto
Filename: libraries/Email.php
Line Number: 2055
Backtrace:
File: D:\xampp\htdocs\prototype\application\controllers\Manage.php Line: 191 Function: send
File: D:\xampp\htdocs\prototype\index.php Line: 315 Function: require_once
A PHP Error was encountered Severity: Warning
Message: fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (Unknown error)
Filename: libraries/Email.php
Line Number: 2055
Backtrace:
File: D:\xampp\htdocs\prototype\application\controllers\Manage.php Line: 191 Function: send
File: D:\xampp\htdocs\prototype\index.php Line: 315 Function: require_once