I am currently hosting a web application on a DigitalOcean Droplet and need to send emails using Gmail SMTP.
However, my server is unable to establish a connection to smtp.gmail.com on ports 587 and 465. When I run the following command: telnet smtp.gmail.com 587
the connection times out. At the same time, ping smtp.gmail.com works correctly, which indicates that the network itself is reachable.
This issue is preventing my deployed website from sending transactional emails. I understand that outbound SMTP traffic may be restricted by default, so I would like to request that outbound SMTP access on ports 587 and 465 be unblocked for my Droplet.
Please let me know if you need any additional information from my side to proceed with this request.
Thank you.
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!
Hey!
Yes, the SMTP ports (25, 465, and 587) are blocked on all Droplets for new accounts to prevent spam and other abuses:
Even if SMTP were available, DigitalOcean strongly recommends against running your own mail server in favor of using a dedicated email deliverability platform. Dedicated email deliverability platforms are better at handling deliverability factors like IP reputation.
To send mail from DigitalOcean, they recommend using an SMTP service like SendGrid or https://smtpfa.st/ or any other reliable SMTP service.
Alternatively, you could reach out to the DigitalOcean support team and check if they could lift the block for you but in many cases this is not possible:
Another option is to use a non-standard SMTP port like 2525 for example if your SMTP provider allows it.
Heya, @tiendung02
SMTP ports 25, 465, and 587 are blocked on Droplets to prevent spam and other abuses on our platform. This block applies to all Droplets by default and includes traffic passing through a Reserved IP address.
Even if SMTP were available, we strongly recommend against running your own mail server, as self-hosted mail servers are difficult to secure and maintain, frequently get flagged as spam, and require constant monitoring to protect your IP address. Dedicated email platforms manage these challenges for you.
To send mail from services hosted on DigitalOcean, we recommend using a third-party email as a service provider.
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
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.