Question

SMTP - Nextcloud

Hi everyone,

I am currently running a Nextcloud instance on my server hosted with DigitalOcean, and I am trying to configure email sending via SMTP.

However, I’ve noticed that the standard SMTP ports (465 and 587) appear to be blocked, which prevents successful email delivery from Nextcloud.

Could you please advise what alternatives or workarounds are currently available within DigitalOcean to enable SMTP functionality? Are there any recommended solutions or supported third-party providers that I can integrate with Nextcloud for email sending?

Thank you in advance


Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
May 18, 2025

Hey!

Yes, you’re right, DigitalOcean blocks outbound traffic on default SMTP ports like 465 and 587 to prevent spam. That’s likely why your Nextcloud emails aren’t going through.

A good workaround is to use an SMTP provider that supports alternative ports like 2525. Services like SendGrid, Sendinblue, Mailgun, or SMTP2GO usually support these and work well with Nextcloud. Alternatively, you could use the provider’s API instead of SMTP, which tends to be more reliable, I know that SendGrid offers this.

More info on the SMTP restrictions here: https://docs.digitalocean.com/support/why-is-smtp-blocked/

You can also try reaching out to support to see if they can lift the block for you: https://do.co/support

- Bobby

KFSys
Site Moderator
Site Moderator badge
May 18, 2025

Yea, the issue is that those ports are blocked for security reasons.

https://docs.digitalocean.com/support/why-is-smtp-blocked/

You can try and use providers that allow using alternative ports to 465 or 587.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.