Smtp.gmail.com not working on Localhost

Hi, I’ve set up a form with email for the first time but I’m getting this error on localhost:
“Connection could not be established with host smtp.gmail.com

Wamp latest version php7 with extensions openssl and smtp enabled.
Grav latest version with plugins updated

It works on my VPS DigitalOcean with no problems.
It also works if I run the test
bin/plugin email test-email -t
but I’m running it from the new Ubuntu bash on Windows, so that might be different.

What do you think is the problem?

I had to use Sendmail rather than SMTP on my website (Linux host)

Sorry if I just saw this. What’s the real difference with sendmail? I’m not sure if that will work on my DigitalOcean.
And how do I set it up?

Thanks