I'm trying to send message using PHPMailer and google SMTP, but i got an error
Connection: opening to ssl://smtp.gmail.com:465, t=10, opt=array ( 'ssl' => array ( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ),) SMTP ERROR: Failed to connect to server: Connection timed out (110) SMTP connect() failed.
Mail sends fine from server on my local machine, but it doesnt work on my VPS (Debian 9). The port 465 is listening, this what i see when calling command
netstat -pln -t
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 15436/master
tcp6 0 0 :::465 :::* LISTEN 15436/master
when im trying connect to google SMTP using telnet
telnet smtp.gmail.com 456
i got
Trying 173.194.73.109...
and nothing happens then. Just empty command line with cursor, and i cant even exit telnet with ^], i have to restart my ssh connection. Same with port 587.
UPD: After a lot of time waiting i got telnet error
Unable to connect to remote host: Network is unreachable
btw ping 173.194.73.109
works fine
telnet localhost 465
also works fine
iptables -A INPUT -p tcp --dport 465 -j ACCEPT
andiptables -A OUTPUT -p tcp --sport 465 -j ACCEPT
but it didnt held – Игорь Быстревскийiptables -L
i gotACCEPT tcp -- anywhere anywhere tcp spt:urd
on both input and output – Игорь Быстревский