Nodemailer Works in Development but Fails in Production – How Can I Fix This?

I’m using Nodemailer in my Node.js app with Gmail’s SMTP to send emails. It works fine in my development environment, but in production, emails aren’t being sent. I’ve set up my environment variables and confirmed they are loaded correctly. Here’s the code:

const nodeMailer = require("nodemailer");

exports.sendEmail = async (options) => {
  const transporter = nodeMailer.createTransport({
    service: "gmail",
    auth: {
      user: process.env.SMPT_MAIL,
      pass: process.env.SMPT_PASSWORD,
    },
  });

  const mailOptions = {
    from: process.env.SMPT_MAIL,
    to: options.email,
    subject: options.subject,
    html: options.message,
  };

  await transporter.sendMail(mailOptions);
};