使用Nodemailer在我的服务器上发送1500封邮件时出现问题...
错误讯息:
代理错误 代理服务器从上游服务器收到无效响应。 代理服务器无法处理请求POST /选项/电子邮件/发送。 原因:从远程服务器读取时出错 位于**********端口80的Apache / 2.4.7(Ubuntu)服务器
我的代码:
sendEmailing: function(request, response) {
var mail = request.body.mail,
transporter = nodemailer.createTransport(smtpTransport({
host: 'SSL0.OVH.NET',
port: 465,
secure: true,
auth: {
user: '*******',
pass: '*******'
}
}));
this.userDao.getAllByRight(mail.usersRight).success( function(users) {
console.log(users.length + ' utilisateurs !!');
async.map(users, function(user, callback) {
transporter.sendMail({
from: mail.from,
to: user.email,
subject: mail.subject,
html: mail.body
}, function(error, info){
if(error) return console.log(error);
console.log('Message sent: ' + info.response);
});
callback(null, users);
}, function(err, results){
console.log(err, results);
request.flash('success', users.length + ' e-mail(s) envoyé(s)');
response.redirect('/option/emailing/new');
});
});
},