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

相關文章
相關標籤/搜索