I try to send a local email with codeIgniter.
// envoi du mail
public function envoiMail(){
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'XXXXXX',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'crlf' => '\r\n',
'newline' => '\r\n',
);
$sujet = $this->input->post('sujet');
$message = $this->input->post('message');
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'Name');
$this->email->to('[email protected]');
$this->email->subject($sujet);
$this->email->message($message);
$this->email->send();
if($this->email->send()){
// mail transmis
echo "ok";
}else{
// erreur de transmission
echo"erreur d'envoi";
}
}
when I test I get this error: Message: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed.