【问题标题】:How can I use a GSuite account for sending mails through node.js?如何使用 GSuite 帐户通过 node.js 发送邮件?
【发布时间】:2020-11-13 09:34:15
【问题描述】:

我正在创建一个 Web 应用程序,我想通过 Node.js (nodemailer) npm 包创建一个邮件发送功能。

  1. 如果我可以使用Gmail帐户,我可以实现它。
  2. 但我无法使用 GSuite 帐户 (example@domain.com) 发送电子邮件。
  3. 我还创建了一个服务帐户并使用(2LO 身份验证),但未能使其工作。

我该如何解决?

【问题讨论】:

标签: node.js email google-oauth gmail-api nodemailer


【解决方案1】:

我知道,如果您使用免费的 Gmail 帐户,但如果您使用正确的 G Suite 帐户,您就可以做到这一点?

您是否特别收到错误消息?

正如 Saurabhchauhan232 在他的评论中提到的,您可能需要允许不太安全的应用程序。

如果您使用 G Suite 帐户登录,只需点击此链接并打开此选项 -----> https://myaccount.google.com/lesssecureapps

有关更多指导,请访问此页面 ---_> 不太安全的应用和您的 Google 帐户:https://support.google.com/accounts/answer/6010255

如果您没有看到此选项,则意味着您首先需要允许用户能够从管理控制台打开它----> 控制对不太安全的应用程序的访问:https://support.google.com/a/answer/6260879?hl=en

基本上这个选项在 admin.google.com > 安全 > 不太安全的应用中

【讨论】:

    猜你喜欢
    • 2018-05-20
    • 2018-10-13
    • 1970-01-01
    • 2020-09-07
    • 1970-01-01
    • 1970-01-01
    • 2010-10-19
    • 2021-03-17
    • 1970-01-01
    相关资源
    最近更新 更多