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...