如@GokulKathirvel所述,只有付费帐户才能发送出站电子邮件。但是我能够证明功能仪表板中的功能。触发该功能时,您会收到以下消息:
未配置结算帐户。无法访问外部网络,并且配额受到严格限制。配置计费帐户以消除这些限制
有了这一点,您还应该能够使用node package来做到这一点
mailgun-js。
var functions = require('firebase-functions')var mailgun = require('mailgun-js')({apiKey, domain})exports.sendWelcomeEmail = functions.database.ref('users/{uid}').onWrite(event => { // only trigger for new users [event.data.previous.exists()] // do not trigger on delete [!event.data.exists()] if (!event.data.exists() || event.data.previous.exists()) { return } var user = event.data.val() var {email} = user var data = { from: 'app@app.com', subject: 'Welcome!', html: `<p>Welcome! ${user.name}</p>`, 'h:Reply-To': 'app@app.com', to: email } mailgun.messages().send(data, function (error, body) { console.log(body) })})来源https://www.automationfuel.com/firebase-functions-sending-
emails/



