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.