wasp emailSender failing with connection timeout but local non-wasp email sending works fine?
Using SMTP connection, it worked fine two days ago and I haven't changed any env variables. Have a local Python to connect to the SMTP and send a test emal and that still works fine. Checked Mailersend and no status changes on their end.
4 Replies
Hi @ralph. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I don’t have a specific report of SMTP emailSender timeouts in the knowledge sources. They only cover how to configure emailSender and providers (Dummy/SMTP/Mailgun/SendGrid), not runtime timeout troubleshooting. I’m sorry, but there’s no information about a known regression or fix for SMTP timeouts where non-Wasp SMTP works at the same time.
What you can try based on related threads and docs:
- Verify your emailSender config in main.wasp still points to SMTP and that your .env.server has SMTP_HOST/USERNAME/PASSWORD/PORT set as before (Wasp reads these at build/start) (Sending Emails, Providers → SMTP).
- Run wasp clean, then start again to ensure config/env are reloaded (this helped in email-related issues in other threads) (pg-boss thread suggestion).
- If you’re on macOS and recently updated anything, consider IPv6 vs IPv4 differences: some users fixed DB connectivity by switching localhost to 127.0.0.1 in connection strings. While those threads are about Postgres/pg-boss, the symptom was connection errors that only appeared in Wasp. If your SMTP host resolves to localhost, try 127.0.0.1 instead (or ensure your SMTP_HOST is a resolvable IPv4 address) (IPv6 vs IPv4 discussion, follow-up where 127.0.0.1 worked, maintainers noting IPv6/localhost nuance).
If the issue persists, please share:
- Your main.wasp emailSender block and whether you use SMTP_HOST=localhost vs 127.0.0.1.
- Any recent OS/Node changes.
- The exact timeout error message and when it occurs (on build or at send time).
References: configuration and providers setup (SMTP) (https://wasp-lang.dev/docs/advanced/email, https://wasp-lang.dev/docs/advanced/email#providers). IPv6/localhost connectivity quirks observed in related Wasp services (pg-boss/DB) (https://discord.com/channels/686873244791210014/1179895919471247490). Running wasp clean suggestion from related thread (https://discord.com/channels/686873244791210014/1098429088164753498).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @ralph, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
hmmm same config works on local wasp start let me try redeploying a new build
hm yeah it seems like theres a problem on the deployed side so weird will poke around some more
wait no…
@Wasp Team they blocked SMTP outbound connections on railway plans under pro 😭
changed occurred just a couple days ago
damn
we'll make a note to call it out in our docs
thanks!
We made a task to add a note in the docs https://github.com/wasp-lang/wasp/issues/3108
GitHub
Documentation: Add note for providers blocking SMTP connections · ...
It seems that some providers are blocking outbound SMTP connections from their servers: at least Railway (below Pro plan) and Hetzner. We should make sure to call this out in our documentation for ...