-注册用户后,我想向用户发送一封带有适当问候的电子邮件,并且我正在使用快速邮件程序库(https://www.npmjs.com/package/express-mailer)。
-但是我收到以下消息:
-这是我的功能:
sendEmail(){
var app = require('express')(),
mailer = require('express-mailer');
app.get('/', function(req, res, next) {
app.mailer.send('email', {
from: 'fakemailk@gmail.com',
to: this.inputEmail.value,
host: 'smtp.gmail.com',
secureConnection: true,
port: 465,
transportMethod: 'SMTP',
auth: {
user: 'fakemail@gmail.com',
pass: 'fakemail'
}
}, function(err) {
if(err){
console.log(err);
res.send("There was an error sending the email");
return;
}
res.send("Welcome!");
});
});
}