This error most often occur when the firewall was blocking the outgoing port. make sure the firewall enabled for smtp port. Still you haven’t solve this error you must have to check SELINUX on your system whether it has active or not.
If it be enabled then just turn to disabled you will get rid of this issue.
# vi /etc/selinux/config