Firebase发送电子邮件功能

Mar*_*rko 2 gmail firebase

我一直在玩firebase教程和新功能,并试图实现这个特定的例子:https: //github.com/firebase/functions-samples/tree/master/quickstarts/email-users

当我触发触发器时,邮件不会被发送,我在日志控制台中收到以下错误:

Error: Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8  https://support.google.com/mail/?p=BadCredentials 141sm3120746ioe.47 - gsmtp
    at SMTPConnection._formatError (/user_code/node_modules/nodemailer/lib/smtp-connection/index.js:557:19)
    at SMTPConnection._actionAUTHComplete (/user_code/node_modules/nodemailer/lib/smtp-connection/index.js:1248:34)
    at SMTPConnection._responseActions.push.str (/user_code/node_modules/nodemailer/lib/smtp-connection/index.js:340:26)
    at SMTPConnection._processResponse (/user_code/node_modules/nodemailer/lib/smtp-connection/index.js:706:20)
    at SMTPConnection._onData (/user_code/node_modules/nodemailer/lib/smtp-connection/index.js:509:14)
    at TLSSocket._socket.on.chunk (/user_code/node_modules/nodemailer/lib/smtp-connection/index.js:461:47)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at TLSSocket.Readable.push (_stream_readable.js:134:10)
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?它没有说关于在电子邮件帐户上放置一些授权的问题.只是密码.应该很简单.

Jaa*_*hdi 5

如果您键入:firebase functions:config:get在终端中,您将能够看到gmail和密码是双引号.我是这样的:

{
  "gmail": {
    "password": ""pass"",
    "email": ""user@gmail.com""
  }
}
Run Code Online (Sandbox Code Playgroud)

所以我在终端输入这样的东西,它对我有用: 没有标记

firebase functions:config:set gmail.email=user@gmail.com gmail.password=pass
Run Code Online (Sandbox Code Playgroud)