A PHP Error was encountered
Severity: Warning
Message: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Permission denied)
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'user',
'smtp_pass' => 'password',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("rn");
2
Answers
Try defining your EMAIL_SMTP_HOST to
If by chance it doesnt work check your EMAIL_SMTP_PORT it may be different to what you set there
Lastly check if by chance your SSL Certificate is installed in your server,same to the mail server also make sure your cridentials both "SMTP_USERNAME" and "SMTP_PASSWORD" are correct.
If you’re running Red Hat-derivatives, they come with SELinux enabled by default, and probably
php-fpm
is denied access to create socket. Try checking it by runninggrep php /var/log/audit/audit.log | grep denied
.If so, you can run
/usr/sbin/setsebool httpd_can_network_connect 1
as root, then try to run the code again.