简体   繁体   English

nodemailer 谷歌工作区无法创建新的访问令牌

[英]nodemailer google workspace cant create new access token

I keep on getting this error my email system worked when I tested it with ethereal email but now I have tried to use it with Gsuite I am getting this error when my server tries to send from my google workspace email.我不断收到此错误,我的 email 测试它时,我的 email 系统正常工作,但现在我尝试将它与 Gsuite 一起使用,当我的服务器尝试从我的谷歌工作区 Z0C83F57C3731A0B4A39EFABC 发送时,我收到此错误

I have tried to use the google cloud platform tutorial https://developers.google.com/gmail/api/quickstart/nodejs and I am still getting this error I have also tried to set up a service account with the google cloud platform.我曾尝试使用谷歌云平台教程https://developers.google.com/gmail/api/quickstart/nodejs ,但我仍然收到此错误我还尝试使用谷歌云平台设置服务帐户。

Could it be I did either of these processes wrong or something else, I am unsure of where to go.可能是我做错了这些过程中的任何一个或其他原因,我不确定 go 在哪里。

Error: Can't create new access token for user
    at XOAuth2.generateToken (C:\Users\***\lib\xoauth2\index.js:184:33)
    at XOAuth2.getToken (C:\Users\***\lib\xoauth2\index.js:123:18)
    at SMTPConnection._handleXOauth2Token (C:\Users\***\lib\smtp-connection\index.js:1687:27)
    at SMTPConnection.login (C:\Users\***\lib\smtp-connection\index.js:530:22)
    at C:\Users\***\lib\smtp-transport\index.js:374:32
    at SMTPConnection.<anonymous> (C:\Users\***\lib\smtp-connection\index.js:209:17)
    at Object.onceWrapper (events.js:421:28)
    at SMTPConnection.emit (events.js:315:20)
    at SMTPConnection._actionEHLO (C:\Users\***\lib\smtp-connection\index.js:1303:14)
    at SMTPConnection._processResponse (C:\Users\***\lib\smtp-connection\index.js:932:20)
    at SMTPConnection._onData (C:\Users\***\lib\smtp-connection\index.js:739:14)
    at TLSSocket.SMTPConnection._onSocketData (C:\Users\***\lib\smtp-connection\index.js:189:44)
    at TLSSocket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:284:9)
    at TLSSocket.Readable.push (_stream_readable.js:223:10) {
  code: 'EAUTH',
  command: 'AUTH XOAUTH2'
}

Are there any suggestions on how I fix this problem and do you need any more information to help me fix this problem?对我如何解决此问题有任何建议吗?您是否需要更多信息来帮助我解决此问题?

The problem was that I had to set up the oauth2 authentification in the https://developers.google.com/oauthplayground/ and allow mail.google access this in turn will get you a refresh token that you can use to generate your access token to solve the problem being caused in this response.问题是我必须在https://developers.google.com/oauthplayground/中设置 oauth2 身份验证并允许 mail.google 访问这反过来将为您提供一个刷新令牌,您可以使用它来生成您的访问令牌解决此响应中引起的问题。

I looked within the code of the library to see what exactly was going on and it helped put me in the right direction.我查看了库的代码,看看到底发生了什么,它帮助我找到了正确的方向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM