var mailer = require(‘nodemailer’); var config = require(‘…/config’); var util = require(‘util’); var transport = mailer.createTransport(config.mail_opts); var SITE_ROOT_URL = ‘http://’ + config.host; var sendMail = function (data) { if(config.debug) { return; } transport.sendMail(data, function (err) { if(err) { console.log(err); }else{ console.log("success send mail",data); } }); }; exports.sendMail = sendMail;
config 部分
var wellknown = require(‘nodemailer-wellknown’); var config = { // 邮箱配置 mail_opts: wellknown(‘126’) } config.mail_opts.auth = { user: '[email protected]’, pass: ‘xxxxxx’ };
126 邮箱上的设置
但是 发送邮件时依然
{ [Error: Invalid login] code: 'EAUTH’, response: '535 Error: authentication failed’, responseCode: 535 }
百度了一些资料还是无法解决 请大神们指导