Closed ItsThatFox closed 3 years ago
I am also getting the same error
Same error with this
` ... const auth = { auth: { api_key: API_KEY, domain: DOMAIN } };
const nodemailerMailgun = nodemailer.createTransport(mg(auth));
nodemailerMailgun.sendMail(
{
from: REMOVED,
to: REMOVED, // An array if you have multiple recipients.
subject: 'Hey you, awesome!',
//You can use "html:" to send HTML email content. It's magic!
html: 'Wow Big powerful letters',
//You can use "text:" to send plain-text content. It's oldschool!
text: 'Mailgun rocks, pow pow!'
},
(err, info) => {
if (err) {
console.log(Error: ${err}
);
} else {
console.log(Response: ${info}
);
}
}
);`
Resolved. DOMAIN is sandboxXXXmailgun.org not https://api.mailgun.net/v3/sandboxXXXmailgun.org
I'm trying to send email via Nodemailer and Mailgun via this package. I keep getting this error:
data: TypeError: Cannot read property 'id' of undefined at Object.send (/app/node_modules/nodemailer-mailgun-transport/src/index.js:126:51)
This is my code: