GMail API-我可以使用服务帐户发送电子邮件吗? [英] GMail API - Can I send email using the Service Account?

查看:62
本文介绍了GMail API-我可以使用服务帐户发送电子邮件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用GMail API发送电子邮件时,我获得了要向其发送消息的用户的访问令牌,然后在发送消息时,在发件人"字段中添加了一些值.

When I send an email using the GMail API, I get an Access Token for the user to whom the message is to be sent and then when sending the message, I put some value in the From Field.

但是无论我在发件人"字段中输入什么内容,电子邮件中的消息均显示为我",并且在已发送邮件"和收件箱"中.

But no matter what I put in the from field, the message in the email shows as From "Me" and is in the Sent mails as well as Inbox.

有没有办法,我可以使用服务帐户发送电子邮件,这样它就不会显示为我",也不会显示在已发送邮件"中.

Is there a way, I could use the Service Account to send the email, so that it does not show up as From "Me" and is also not in the Sent Mails.

推荐答案

否. Gmail API适用于Gmail用户,服务帐户仅用于对真实Gmail帐户进行身份验证,他们没有自己的Gmail帐户,等等.

No. The Gmail API is for Gmail users and service accounts are just for doing auth to a real Gmail account, they don't have their own Gmail account, etc.

如果要通过某些服务发送电子邮件,则需要一些批量发送电子邮件服务,例如:

If you want to send the email from some service, you need some bulk-sending email service like at: https://cloud.google.com/compute/docs/tutorials/sending-mail/ or something you run yourself or from some other provider.

这篇关于GMail API-我可以使用服务帐户发送电子邮件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆