A
ADEKOLA Abdwahab
Guest
A while ago, I had to move some services from Render to DigitalOcean Droplets. The migration went smoothlyโuntil I noticed something odd.
Emails werenโt going out.
Every attempt ended with a timeout error. Frustrating.
At first, I suspected our email provider. A quick search even revealed a few people complaining about similar issues, so I confidently pointed fingers in that direction and proposed switching providers.
But then the unexpected happenedโthe exact same issue occurred with the new provider.
Meanwhile, everything worked perfectly on my local machine.
Thatโs when the lightbulb went on.
The issue wasnโt with the providers at allโฆ it was with DigitalOcean itself.
After digging deeper, I discovered that DigitalOcean blocks all popular SMTP ports (25, 465, 587, etc.).
They do this intentionally to reduce spam, prevent abuse, and protect instance IP reputations.
Unfortunately for me, this meant any attempt to connect via the usual SMTP routes was doomed to fail.
Thankfully, my SMTP provider happened to support an alternate port that DigitalOcean didnโt block.
I switched to that port, and emails started flowing again.
But this was just a temporary fix.
Moving forward, Iโve decided to avoid relying on SMTP altogether. Instead, Iโll be using email provider APIs for sending emails. Theyโre faster, more reliable, and not at the mercy of port restrictions.

What started out looking like a provider issue turned out to be a hosting environment limitation.
It reminded me of a simple but important lesson:
And just like that, my brief urge to build a custom SMTP server quietly died.
Continue reading...
Emails werenโt going out.
Every attempt ended with a timeout error. Frustrating.
At first, I suspected our email provider. A quick search even revealed a few people complaining about similar issues, so I confidently pointed fingers in that direction and proposed switching providers.
But then the unexpected happenedโthe exact same issue occurred with the new provider.
Meanwhile, everything worked perfectly on my local machine.
Thatโs when the lightbulb went on.
The issue wasnโt with the providers at allโฆ it was with DigitalOcean itself.
The Real Culprit: Blocked SMTP Ports
After digging deeper, I discovered that DigitalOcean blocks all popular SMTP ports (25, 465, 587, etc.).
They do this intentionally to reduce spam, prevent abuse, and protect instance IP reputations.
Unfortunately for me, this meant any attempt to connect via the usual SMTP routes was doomed to fail.
The Workaround
Thankfully, my SMTP provider happened to support an alternate port that DigitalOcean didnโt block.
I switched to that port, and emails started flowing again.

But this was just a temporary fix.
The Better Approach
Moving forward, Iโve decided to avoid relying on SMTP altogether. Instead, Iโll be using email provider APIs for sending emails. Theyโre faster, more reliable, and not at the mercy of port restrictions.

Lesson Learned
What started out looking like a provider issue turned out to be a hosting environment limitation.
It reminded me of a simple but important lesson:
Always question your assumptions before blaming the wrong part of the stack.
And just like that, my brief urge to build a custom SMTP server quietly died.

Continue reading...