Sometimes, your domain points to external mail server such as google apps in this case you need to setup your smtp server to gmail or other third party. But sometimes, although values in your script are set correctly, while sending an email you get following error.
Failed to send test email. Error message: SMTP Error: Could not connect to SMTP host.
It might be caused because of wrong settings in the script or firewall.
Use SMTP when sending emails from this system Yes
SMTP hostname (eg: mail.yoursite.com) smtp.gmail.com
SMTP Security – TLS
Use SMTP authentication – Yes
SMTP Username – your user name
SMTP Password – your password.
SMTP port – 465
If your settings are correct, then you would need to make sure that you do not enable SMTP_BLOCK in csf.conf if you want to allow such connections.
Edit csf.conf file and set!
SMTP_BLOCK = “0”