Я пытаюсь создать активационную электронную почту, но у меня возникла проблема.
var email = {
from: 'Localhost staff, staff@locahost.com',
to: user.email,
subject: 'Localhsot activation link',
text: 'Hello ' + user.name + ', Thank you for regstring at localhost.com. Please click in the following link to compelet your activation: http://localhost:8000/activate/' + user.tomporarytoken,
html: 'Hello<strong>' + user.name + '</strong>,<br><br> Thank you for regstring at localhost.com. Please click in the link below to compelet your activation: <br><br><a href="http://localhost:8000/activate/' + user.tomporarytoken + '" >http://localhost:8000/activate/</a> '
};
client.sendMail(email, function(err, info){
if (err){
console.log(err);
}
else {
console.log('Message sent: ' + info.response);
}
});
res.json({ success: true, message: 'Account registed!, Please check your e-mail for activation link.' });
}
});
}
});
При завершении регистрации он должен был дойти до последнего случая и дать мне набор сообщений, но с ошибкой, что произойдет?
Error: Bad username / password
at Request._callback (C:\Users\Hi.Tech\Documents\Mohammed ELamine\Index\Project Simple (Backend + frontend)\Full-Stack-Mean-Js\node_modules\sendgrid\lib\sendgrid.js:88:25)
at Request.self.callback (C:\Users\Hi.Tech\Documents\Mohammed ELamine\Index\Project Simple (Backend + frontend)\Full-Stack-Mean-Js\node_modules\request\request.js:185:22)
at Request.emit (events.js:189:13)
at Request.<anonymous> (C:\Users\Hi.Tech\Documents\Mohammed ELamine\Index\Project Simple (Backend + frontend)\Full-Stack-Mean-Js\node_modules\request\request.js:1161:10)
at Request.emit (events.js:189:13)
at IncomingMessage.<anonymous> (C:\Users\Hi.Tech\Documents\Mohammed ELamine\Index\Project Simple (Backend + frontend)\Full-Stack-Mean-Js\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:277:13)
at IncomingMessage.emit (events.js:194:15)
at endReadableNT (_stream_readable.js:1125:12)
at process._tickCallback (internal/process/next_tick.js:63:19)