Sending E-Mail through firebase functions

2020-04-16 02:04发布

问题:

Its there a way to use an API like(sendgrid, mailgun) to send Email through Firebase cloud functions or it is considered as an Outbound connection?

回答1:

Assuming you're asking because you're on the free Firebase plan. As explained on the Firebase pricing page:

The Spark plan allows outbound network requests only to Google-owned services.

Luckily, there is a Google-owned service that allows mail sending; Gmail! There is a quick-start sample available or a related StackOverflow answer, but the method has the following limits:

You may see this message if you send an email to a total of more than 500 recipients in a single email and or more than 500 emails in a day sent.

There is no Google-owned mail API that allows unlimited emails. As the quick start sample linked above states:

If you are planning on sending a large number of emails you should use a professional email sending platform such as Sendgrid, Mailjet or Mailgun.