I'm posting because I've already gone through the solutions posted in other questions on here but they haven't helped.
What I am trying to do is send email using Swiftmailer through Google Apps for Business Gmail but I keep getting this error:
Connection could not be established with host smtp.gmail.com [Connection timed out #110]
I know the code is fine because it works on my local machine but not on the production server.
What I have tried so far:
Configuration:
# Swiftmailer Configuration
swiftmailer:
transport: smtp
encryption: ssl
auth_mode: login
host: smtp.gmail.com
username: [email protected]
password: applicationspecificpassword
port: 465
What else can I try? Could this be a DNS issue since I am using Gmails SMTP MX records instead of the servers.
The following steps worked for me :
Check if httpd_can_sendmail is on , run this getsebool httpd_can_sendmail
setsebool -P httpd_can_sendmail 1
Check also if httpd_can_network_connect is on, run getsebool httpd_can_network_connect
setsebool -P httpd_can_network_connect 1
'host' => '64.233.166.108'
'port' => '465'
I'm using Centos