【问题标题】:How to send an email on behalf of a Google Group with the GMail API如何使用 GMail API 代表 Google 群组发送电子邮件
【发布时间】:2015-11-27 00:12:14
【问题描述】:

我们希望我们的应用程序在 FROM 标头中发送带有 google 群组电子邮件的电子邮件。

这在 GMail 界面中是可能的,前提是正确配置了 Google Group。

但是当我们尝试使用 GMail API 时,我们得到了错误:

403 Forbidden

cache-control:  private, max-age=0
content-encoding:  gzip
content-length:  175
content-type:  application/json; charset=UTF-8
date:  Thu, 04 Sep 2014 11:05:36 GMT
expires:  Thu, 04 Sep 2014 11:05:36 GMT
server:  GSE

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "forbidden",
    "message": "XXX.XXXX@XXXXX.XXX does not have privileges to XXX.XXXX@XXXXX.XXX mailbox."
   }
  ],
  "code": 403,
  "message": "XXX.XXXX@XXXXX.XXX does not have privileges to XXX.XXXX@XXXXX.XXX mailbox."
 }
}

有没有办法通过 GMail API 或 App Engine 的邮件功能来规避这个问题?

【问题讨论】:

    标签: google-app-engine gmail-api google-groups


    【解决方案1】:

    您需要将该组作为所有者添加到项目中。

    【讨论】:

      【解决方案2】:

      不要尝试将组放在 URL 中,只需使用“我”,即正常身份验证的用户。如果该用户确实在 gmail Web 界面中将该组配置为有效的发件人地址(他们必须完成验证流程以通过单击链接确认他们拥有该地址 - 他们可以发送电子邮件“发件人”该组使用网络界面),那么您应该能够简单地发送一封电子邮件,其中“发件人”标头是该组,它将被接受。

      【讨论】:

      • 确实成功了,我不知道为什么我们的第一次尝试失败了。
      猜你喜欢
      • 2019-10-16
      • 2017-04-14
      • 2019-01-22
      • 2018-09-11
      • 1970-01-01
      • 2018-01-26
      • 2014-09-16
      • 2014-08-27
      • 2018-02-23
      相关资源
      最近更新 更多