Unable to connect to gmail smpt

I have been trying to set up outgoing email via our smtp gmail server but get the following error message.

3: Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array()
3: Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused) [/home/*/public_html//vendor/phpmailer/phpmailer/src/SMTP.php line 344]
1: SMTP ERROR: Failed to connect to server: Connection refused (111)

Not sure what to do now.

Hi and welcome!
maybe your credentials actually do not work. Gmail offers to create app passwords instead, if I remember correctly, I needed to do that on a test system too.

I’m pretty sure you have to create an app password. If not, will try to get you to fill in a CAPTCHA, which obviously suitecrm cannot. You also must have an SSL enabled or it won’t connect. Easiest option is to create an app password.

https://support.google.com/accounts/answer/185833?hl=en