使用Google API获取用户的所有电子邮件地址 [英] Get all email addresses of user using Google API

查看:683
本文介绍了使用Google API获取用户的所有电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我自己的Gmail账户,我有多个电子邮件地址与之相关联。例如,我有一个与我的Gmail相关联的电子邮件地址,我可以从我的Gmail邮件发送电子邮件,就像他们来自我的大学电子邮件地址一样。

For my own gmail account, I have multiple email addresses associated with it. For example, I have an email address from my university that is associated with my gmail, and I can send emails from my gmail as if they are coming from my university email address.

我正在阅读Google API,我看到我可以获得用户的Gmail地址,但是我也可以获得与他们的Gmail帐户相关联的任何其他电子邮件地址?

I'm reading up on the Google APIs, and I see that I can get a user's gmail address, but can I also get any other email address that is associated with their gmail account?

当用户登录到我的网站时,我想向他们介绍与Gmail相关联的电子邮件地址的列表,并让他们选择他们想要使用的电子邮件地址。

When a user logs in to my site, I'd like to present them with a list of the gmail-associated email addresses and let them select the one they would like to use.

编辑:感谢大家的答案,但我不认为他们都回答了这个问题。我一直在玩 Google的OAuth游乐场。很奇怪,我可以获得很多非常个人的信息(用户的联系人列表,甚至收到的电子邮件),但是我无法获取用户的其他电子邮件地址。

Thanks everyone for the answers, but I don't think any of them answers the question. I've been playing with Google's OAuth playground. It is strange that I can get lots of very personal information (a list of a user's contacts and even received emails) but I can't get the user's alternative email addresses.

推荐答案

你的描述有点模糊。你在谈论发送别名帐户或备用电子邮件帐户?

Your description is a little vague. Are you talking about send-as alias accounts or alternate email accounts?

发送别名

无论哪种方式,您都可以通过以下方式与send-as帐户进行交互:管理发送别名

Either way, you can interact with the send-as accounts here: Manage Send-as Alias

通过管理SDK替代电子邮件


  • 对于备用电子邮件帐户,可以通过以下方式访问它们:
    • As for alternate email accounts, they can be accessed via:
      • Admin SDK: https://developers.google.com/admin-sdk/directory/v1/guides/manage-user-aliases?hl=en
      • Google Apps Script: https://developers.google.com/apps-script/reference/gmail/gmail-app#getAliases()
      • Email addresses associated with your account
      • Alternate email addresses and other Google products
      • Connect other email accounts to your Google Account

      联合登录

      Federated Login

      此外,我不确定您是如何将此功能纳入您的网站,但我建议您检查的另一个区域是 Google帐户用户的联合登录

      Also, I'm not exactly sure how you are trying to incorporate this functionality into your site but another area I recommend checking out is Federated Login for Google Account Users. This might also provide you with the functionality you seek.


      使用联合登录(也称为联盟身份),您的网站
      或应用程序可以允许访问者使用其Google用户
      帐户登录。联合登录使用户不必为不同的网站设置单独的
      登录帐户,并免除您执行
      执行登录身份验证措施的任务。

      Using federated login (also known as federated identity), your website or application can allow visitors to sign in using their Google user accounts. Federated login frees users from having to set up separate login accounts for different websites, and frees you from the task of implementing login authentication measures.

      这篇关于使用Google API获取用户的所有电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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