Я пытаюсь отправить вложение с помощью nodemailer 0.7.1. Вложение отправлено отлично, но когда я пытаюсь его открыть, на экране появляется сообщение OPRING FILE.Приложение Nodemailer не работает в nodemailer 0.7.1
Вот мой код:
var nodemailer = require("nodemailer");
var transport = nodemailer.createTransport("SMTP", {
host: "smtp.gmail.com", // hostname
secureConnection: true, // use SSL
port: <port>, // port for secure SMTP
auth: {
user: "[email protected]",
pass: "password"
}
});
console.log("SMTP Configured");
var mailOptions = {
from: '[email protected]', // sender address
to: '[email protected]', // list of receivers
subject: 'Report for Test Result', // Subject line
text: 'Contains the test result for the test run in html file', // plaintext body
attachments: [
{
'filename': 'results.txt',
'filePath': './result/results.txt',
}
]
};
transport.sendMail(mailOptions, function (error, response) {
if (error) {
console.log(error);
} else {
console.log("Message sent: " + response.message);
}
});
Любое предложение о том, как решить эту проблему было бы большим подспорьем.