Я развернул приложение node.js в node.js, но не смог просмотреть полные инструкции console.log из своего приложения. Я использую:
heroku logs
Некоторое из журналов отображается, но похоже, что это не полные журналы. Есть ли пакет node.js для отправки писем из развернутого приложения? Email работает отлично от моего localmachine btw.
Код эл. почты:
console.log('try to send email hold on');
var nodemailer = require("nodemailer");
var smtpTransport = nodemailer.createTransport({
service: "Gmail",
auth: {
user: "[email protected]",
pass: "mypw"
}
});
smtpTransport.sendMail({
from: "Dikkebil", // sender address
to: "[email protected]", // comma separated list of receivers
subject: "Error body", // Subject line
text: 'Error body: ' +error.body+ '\n'+ 'error type:' + error.type +'\n' +'error statuscode:' +error.statusCode +'\n' + 'error args:' + error.arguments[0]
}, function(error, response){
if(error){
console.log(error);
}else{
console.log("Message sent: " + response.message);
}
});