I'm using default code from Nodemailer page (console added by me):
nodemailer.createTestAccount((err, account) => {
console.log(err);
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host: 'smtp.ethereal.email',
port: 587,
secure: false, // true for 465, false for other ports
auth: {
user: account.user, // generated ethereal user
pass: account.pass // generated ethereal password
}
});
});
It returns me the following error:
Error: Invalid status code 500
at ClientRequest.<anonymous> (/Users/angelodias/GIT/bootcamp/04-iniciando-back-end/node_modules/nodemailer/lib/fetch/index.js:221:23)
at ClientRequest.emit (events.js:223:5)
at ClientRequest.EventEmitter.emit (domain.js:475:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:115:17)
at TLSSocket.socketOnData (_http_client.js:456:22)
at TLSSocket.emit (events.js:223:5)
at TLSSocket.EventEmitter.emit (domain.js:475:20)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11) {
type: 'FETCH',
sourceUrl: 'https://api.nodemailer.com/user'
}
What am I doing wrong? Is there any bug?
I tried with .then().catch() and it catches the same error.
Running Node v12.14.1 and Nodemailer 6.4.6