I am trying to connect to mailtrap.io from CentOS server to send emails. The following error occurs:
"Connection could not be established with host mail trap.io [permission denied #13]"
Any ideas how to solve it?
This could be due to SELinux blocking the connection.
I had the same issue and this solved it:
First check to see if httpd can send mail (if it is on or off)
$> getsebool httpd_can_sendmail
$> getsebool httpd_can_network_connect
If the response is: OFF then you could turn it ON as follow:
$> sudo setsebool -P httpd_can_sendmail 1
$> sudo setsebool -P httpd_can_network_connect 1
My source for this solution was Could not connect to SMTP host
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