El error de Nodemailer no se puede arreglar
Tengo una aplicación muy simple, empezando a ensuciarme las manos con nodemailer. Cuando ejecuto la aplicación, obtengo errores en el módulo.
app.js:
const nodemailer = require('nodemailer');
const transporter = nodemailer.createTransport('smtps://me%40gmail.com:[email protected]');
var mailOptions = {
from: '"Me" <[email protected]>', // sender address
to: '[email protected], [email protected]', // list of receivers
subject: 'Hello dude', // Subject line
text: 'Test email with text', // plaintext body
html: "Testing 1..2..7" // html body
};
// send mail with defined transport object
transporter.sendMail(mailOptions, function (error, info) {
if (error) {
return console.log(error);
}
console.log('Message sent: ' + info.response);
});
Y me sale este error:
C:\Users\Andrew\desktop\messy4\node_modules\nodemailer\lib\mailer\index.js:31
compile: [(...args) => this._convertDataImages(...args)],
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (C:\Users\Andrew\desktop\messy4\node_modules\nodemailer\lib\nodemailer.js:3:16)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
Realmente no estoy seguro de lo que está sucediendo aquí.