By noubis21
Hello community,
I have a droplet running on Ubuntu where my Django application needs to send emails. However, I’m facing issues with SMTP ports. Emails are not going through, and I suspect that outgoing connections on common SMTP ports (25, 465, 587) might be blocked.
I already tried testing with:
telnet smtp.gmail.com 587 nc -zv smtp.gmail.com 465
but the connection doesn’t seem to pass.
Has anyone experienced this issue before? Could it be that DigitalOcean blocks these ports by default, and if so, what’s the correct procedure to get them unblocked or to configure an alternative?
Thank you in advance for your help.
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,
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:
https://www.digitalocean.com/community/tutorials/why-you-may-not-want-to-run-your-own-mail-server
Dedicated email deliverability platforms are better at handling deliverability factors like IP reputation.
To send mail from DigitalOcean, they recommend using SendGrid or another 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.
- Bobby.
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.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.