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"