Railway, Render or Vercel won't send my emails via SMTP: why, and how do I fix it?
What each platform (Railway, Render and Vercel) blocks when sending email over SMTP, how to check it with nc, three fixes, and the option of publishing your Node app on Dongee Live with SMTP on 587 and 465.
Railway, Render and Vercel won't send your emails over SMTP because they block, fully or partly, outbound connections to mail ports: Railway only allows SMTP from the Pro plan up, Render blocks it on its free web services, and Vercel blocks only port 25. To fix it you can upgrade your plan, send the email through the HTTPS API of a transactional email service, or use ports 587 or 465 and wait for the send to finish. If your app is Node, another option is to publish it on Dongee Live, which allows outbound SMTP on 587 and 465. Below you'll see how to tell what's happening to you and how to fix it in each case.
Updated November 21, 2026 · Dongee Team
How do I know the problem is an SMTP block?
The same signs almost always show up:
- Email goes out fine locally, but fails in production.
- In the logs you see
ETIMEDOUT,Connection timeoutorGreeting never receivedwhen callingsendMail. - There's no authentication error. The connection doesn't even reach the mail server.
- In serverless functions the HTTP response arrives fine and the email never goes out, with no error at all.
A timeout means the network cuts the connection before it reaches the server. If it were a username or password problem, you'd get a 535 error or similar.
What does each platform block?
These are the facts each platform publishes in its documentation:
- Railway: "SMTP is only available on the Pro plan and above". On Free, Trial and Hobby, outbound SMTP is disabled and Railway recommends using transactional email services with an HTTPS API. After moving to Pro you have to redeploy. Source: Railway documentation on outbound networking.
- Render: since September 26, 2025, free web services block outbound traffic to SMTP ports 25, 465 and 587. Paid instance types do allow it. Source: Render changelog.
- Vercel: blocks only port 25. Ports 465 and 587 are open in Functions with the Node.js runtime, but the Edge runtime can't open SMTP sockets. You also have to
awaitsendMailbefore responding, or useafter/waitUntil, because background work is paused. Source: Vercel guide on functions and SMTP.
| Platform | What it blocks | How to fix it |
|---|---|---|
| Railway (Free, Trial, Hobby) | All outbound SMTP | Move to Pro and redeploy, or use an HTTPS email API |
| Render (free web service) | Ports 25, 465 and 587 | Move to a paid instance or use an HTTPS email API |
| Vercel (Node.js Functions) | Only port 25 | Use 587 or 465 and await the send |
| Vercel (Edge runtime) | Can't open SMTP sockets | Move sending to a Node.js Function or use an HTTPS API |
| Dongee Live (Node apps) | Allows outbound SMTP on 587 and 465 (about 50 emails per hour) | Set host, port and credentials in environment variables |
How do I check whether the port is blocked?
Run a connectivity test from the same environment where the app runs, for example from the service shell or from a deploy command:
- Run
nc -vz smtp.yourdomain.com 587, replacing the host with your mail server's. - If it answers
succeededoropen, the port is open and the failure is somewhere else (credentials, TLS or code). - If it hangs or returns
timed out, the platform is blocking outbound traffic. - Repeat the test with port 465 to rule out that only one of them is closed.
- Run the same test on your own machine. If it works there and not in production, you know the cause.
What fixes do I have?
Should I upgrade my plan?
It's the fastest option if you already use Railway or Render and want to keep using SMTP without changing code. On Railway, remember to redeploy after the change. Check the price of each platform's paid plan first, because you pay for the whole service and not just for being able to send email.
When should I use an HTTPS email API?
Transactional email services offer an API that works over HTTPS (port 443), which none of these platforms block. It works on any plan and also in the Edge runtime. In exchange, you have to change your sending code and depend on an external provider with its own price and limits.
How do I use port 587 or 465 correctly?
Where these ports are open, as in Vercel's Node.js Functions, check two things: the port and TLS mode, and that the function waits for the send to finish. With Nodemailer it would look like this:
import nodemailer from "nodemailer";
const transporter = nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: Number(process.env.SMTP_PORT), // 587 or 465
secure: process.env.SMTP_PORT === "465", // true on 465, STARTTLS on 587
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS,
},
});
export async function POST(req) {
const { email } = await req.json();
await transporter.sendMail({
from: process.env.SMTP_FROM,
to: email,
subject: "Thanks for reaching out",
text: "We received your message.",
});
return Response.json({ ok: true });
}If you want the full step-by-step setup, see the guide to send email from a Node.js app with Nodemailer and SMTP.
What alternative does Dongee offer for Node apps?
Dongee Live publishes apps built with ChatGPT, Lovable, Bolt, v0, Claude Code, Codex, Cursor or VS Code. It supports static sites and Node 20, 22 and 24 (Express, Fastify, Koa, Hono, Next.js standalone and TanStack Start). For email, it works like this:
- It allows outbound SMTP on 587 and 465, with a quota of about 50 emails per hour with the included account, so you can use Nodemailer without changing your code.
- It includes a mailbox meant for low volume, such as contact forms or internal notifications.
- If you need to go beyond that quota, for example for billing and collection emails or mass notifications, you can add MailChannels separately.
- You keep credentials in environment variables (
SMTP_HOST,SMTP_USER, etc.), never in the repository. - It issues and renews HTTPS, maintains the system and the web server, and restarts the app if it goes down.
Plans: Live Free 0 USD (1 app, 1 MariaDB database, MySQL-compatible, and 1 email account), Live Pro 15 USD/month (3 apps) and Live Team 29 USD/month (10 apps). Keep in mind it doesn't support Python, Ruby, PHP or Docker. If your app is Next.js and comes from Bolt or v0, follow the guide to publish a Next.js app from Bolt or v0 with SMTP email.
What mistakes should I avoid after fixing sending?
- Not awaiting
sendMail: in serverless the function freezes and the email never goes out. - Mismatching port and TLS: 465 uses
secure: trueand 587 usessecure: falsewith STARTTLS. - Leaving credentials in the code: always use them as environment variables.
- Forgetting SPF, DKIM and DMARC: the email may go out and still land in spam. Check authentication by following how to check SPF, DKIM and DMARC with "Show original" in Gmail.
Frequently asked questions
Why does my email work locally but not in production?
Because there's no port block on your machine and there is one on the platform. Railway (on non-Pro plans) and Render (on free web services) cut outbound SMTP, and the connection ends in ETIMEDOUT.
Does Vercel block port 587?
No. According to its guide, Vercel blocks only port 25, and ports 465 and 587 are open in Functions with the Node.js runtime. What doesn't work is the Edge runtime, which can't open SMTP sockets.
Is moving to Pro on Railway enough?
Yes, Railway enables SMTP from the Pro plan up, but you have to redeploy the service after the change for it to apply.
Can I use the mailbox included in Dongee Live for bulk email?
The included mailbox is meant for low volume: about 50 emails per hour. If you need more, for example for billing and collection emails, it's best to add MailChannels separately. If you have questions about your case, 24/7 support can help you review it.
Is an HTTPS email API better than SMTP?
It's neither better nor worse: they serve different cases. The API avoids port blocks and works in Edge environments, but it ties you to a provider. SMTP is standard and portable, although it needs the platform to allow outbound traffic on 587 or 465.
In summary
If your emails don't go out, first run the nc test to confirm the block. Then choose an option: upgrade your plan, use an HTTPS API, or use the right port and wait for the send to finish. If your app is Node and you want to keep using SMTP without paying for a higher plan, Dongee Live allows sending on 587 and 465.
Comenta lo que quieras
Unete a la charla
Solo ingresa tu email