0

this email function perfectly work in localhost but it doesn't work in lambda function.

const transporter = nodemailer.createTransport(
  smtpTransport({
  service: "Gmail",
  host: "smtp.gmail.com",
  auth: {
    user: "abc@gmail.com",
    pass: "*******",
  },
})
 

const sendEmail = async () => {
   const mailOptions = {
   from: "abc@gmail.com",
   to: "abcd@gmail.com",
   subject: "Test Email",
   text: `test Email`,
 };

return await transporter.sendMail(mailOptions);

when send the email througth the lambda function got error like this. I have already try Allow less secure apps to be ON but still same error.

  "code": "EAUTH",
  "responseCode": 534,
  "command": "AUTH PLAIN"
Irushan
  • 125
  • 2
  • 10
  • Does this answer your question? [Nodemailer is not able send mail using gmail](https://stackoverflow.com/questions/33493963/nodemailer-is-not-able-send-mail-using-gmail) – Jens Mar 10 '22 at 08:43
  • no. I tried that way but it's not working – Irushan Mar 10 '22 at 12:55

0 Answers0