18 days ago
Hello Railway Support Team,
I’m experiencing an issue with my Node.js backend deployed on Railway.
The application deploys successfully and runs normally at first. My frontend can connect to the backend and send requests to the "/send" endpoint. However, when I attempt to send an email using Nodemailer, the request gets stuck in a “sending” state.
After a short time, the frontend displays “Failed to connect to server,” and I notice that my Railway service crashes, even though it initially showed a successful deployment.
Here are the key details:
- Backend: Node.js (Express)
- Email: Nodemailer with Gmail (App Password)
- Hosting: Railway
- Endpoint: /send (POST request)
Observations:
- The backend works fine until the email function is triggered
- The request hangs and does not return a response
- After this, the Railway service crashes
I’ve already:
- Verified environment variables (EMAIL and PASS)
- Switched to manual SMTP configuration (smtp.gmail.com, port 465, secure)
- Added error handling and logging
The same setup works locally but fails when deployed.
Here is my deployed URL:
https://myportfoliobackend-production-a6a0.up.railway.app/
Could you please help me understand:
- If there are any SMTP or outbound connection restrictions
- Whether this could be a timeout or networking issue
- Any recommended setup for Nodemailer on Railway
Thank you for your support.
Best regards,
Fimanuel
1 Replies
18 days ago
Outbound SMTP is only available on the Pro plan and above, while Free, Trial, and Hobby plans have SMTP disabled. For sending emails from your application, please use a dedicated email service that provides HTTPS APIs. More information can be found in our documentation.
Status changed to Awaiting User Response Railway • 18 days ago
11 days ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 11 days ago