Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
If your account with DigitalOcean is new, then all SMTP actions are blocked and you need to create a ticket with Support via the control panel and ask to un-block SMTP. This is to prevent SPAM.
How did it work on localhost? What tutorial did you follow?
Make sure you’re connecting with it over IPv4, not IPv6. It seems like DO is blocking IPv6 SMTP traffic.
And for what it’s worth, you can test by connecting with Gmail’s servers with the following:
$ telnet smtp.gmail.com 587
Then to test with IPv4:
$ telnet -4 smtp.gmail.com 587
If you see it trying to connect (and failing) with IPv6 with the former command, but succeeding with IPv4 in the latter command, you’ll need make your droplet use IPv4.