nodejs的发邮件模块nodemailer报错

搜索引擎上搜到的类似案例:
node

一、https://cnodejs.org/topic/543c756f91eadb0f73aa33f4#556294908f294e213d10b8d1 git

二、http://support.qualityunit.com/156325-Email-is-not-sent-because-of-failed-authentication(这个有解决方案,可是国外的,大家懂,和国内的不同)github

----------正文----------服务器

错误:搜索引擎

//第一种
{ [Error: Invalid login]
  code: 'EAUTH',
  response: '535 Error: authentication failed',
  responseCode: 535 }
//第二种
 { [Error: Invalid login]
  code: 'EAUTH',
  response: '550 User is locked',
  responseCode: 550 }
//第三种
{ [Error: Mail command failed]
  code: 'EENVELOPE',
  response: '553 Mail from must equal authorized user',
  responseCode: 553 }

错误分析:只要是5开头的错误,大概都是验证出错,链接不上smtp等意思。spa

错误缘由:网易邮箱帮助能够查到smtp服务器和端口,可是没有说明须要用受权码做为密码(之前是用真实密码的,可是不知道何时改了,wiki却不改,坑)。3d

so,解决方案是:其余的按nodemailer的github上的例子写,密码那里写受权码便可。code

ps:受权码能够登陆网易邮箱,绑定手机后获取。索引

亲测成功代码:get

相关文章
相关标签/搜索