DEV Community

mariya tawfik
mariya tawfik

Posted on

Help Needed – Email Sending Issues After Deployment (Node.js/Express)

Hello everyone,

I'm working on a backend project using Node.js and Express, where I send OTPs and password reset emails via Gmail using Nodemailer. Everything works perfectly on my local machine, but I’ve run into several issues after deploying the app using Render (free tier):

With Nodemailer, I configured all the necessary environment variables, but after deployment, I get a timeout error.

I tried switching to Resend (free tier), but it only sends emails to its dashboard—not to the actual user’s email.

Then I moved to Brevo (formerly Sendinblue) free tier. It worked locally, but after deployment, it stopped sending emails entirely.

Finally, I tried SendGrid (free tier). I signed up successfully, but when I try to log in, it says “incorrect password”—even though I’m sure the password is correct. I attempted a password reset and accessed the dashboard, but the login issue persists.

Has anyone faced similar problems with email services after deployment? I’d really appreciate any guidance or suggestions on how to resolve this.

Thanks in advance!

Top comments (1)

Collapse
 
iamutkarshyadav profile image
Utkarsh Yadav

Most likely, your deployed Render instance doesn’t have permission or a reliable network route to reach external SMTP or API servers. The simplest and most reliable way to send emails from a Render-hosted Node.js backend is by using Resend with its official API instead of SMTP. After creating an account on Resend, you’ll need to verify your sending domain by adding SPF and DKIM records to your domain’s DNS settings this step ensures your emails don’t get flagged as spam or blocked. Once your domain is verified, you can integrate Resend directly into your Express backend using its API client.

`import { Resend } from "resend";

const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({
from: "noreply@yourdomain.com",
to: user.email,
subject: "Password Reset OTP",
html: <p>Your OTP is <b>${otp}</b></p>
});
`
hope it helps mate