A PHP Error was encountered
Severity: Warning
Message: stream_socket_enable_crypto(): 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: 1978
Codeigniter does not send e-mail because of this error.
My e-mail code:
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'smtp.gmail.com',
'smtp_port' => 587,
'smtp_crypto' => 'tls',
'smtp_user' => '[email protected]',
'smtp_pass' => 'asd',
'mailtype' => 'html',
'charset' => 'utf-8'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'asd');
$this->email->to($asd);
$this->email->subject($asd);
$this->email->message($asd);
$this->email->send();
This might help someone in the future.
Even if every credential is right, some antivirus or firewall installed in the machine might prevent sending email thru SMTP. Temporarily disabling the antivirus or firewall to check is a good idea.
In my case, Avast antivirus caused this issue, and disabling this resolved my problem.
To disable Avast intercepting SMTP, unchecking Scan outbound emails (SMTP)
checkbox will do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With