Tag: google apps

使用XOAUTH2访问Google域用户电子邮件数据

我正在尝试使用xoauth2从我们的谷歌应用程序访问我们的学生gmail数据。 我一直在这个区域,googles文档的组织非常糟糕,而且还有很多旧的文档不再适用于你所指向的,所以它很有趣。 我基本上使用我创建的已启用域委派的服务帐户在python中使用googles oauth2client来使用以下代码。 from oauth2client.client import SignedJwtAssertionCredentials client_email = ‘serviceaccount@developer.gserviceaccount.com’ with open(“testserviceaccount.p12”) as f: private_key = f.read() credentials = SignedJwtAssertionCredentials(client_email, private_key, ‘https://www.googleapis.com/auth/gmail.readonly’, sub=’student email address’) from httplib2 import Http http_auth = credentials.authorize(Http()) from apiclient.discovery import build service = build(‘gmail’, ‘v1′, http=http_auth ) messages = service.users().messages().list(userId=’student email address’).execute() print messages 我需要这个应用程序的应用程序是在轨道上的ruby,所以我正在寻找任何提示或帮助在Ruby on Rails中使用什么来实现相同的效果。 任何帮助或提示非常感谢。

Rails ActionMailer在开发模式下具有Devise + Google Apps

我正在尝试将ActionMailer配置为使用我的Google Apps帐户以开发模式从Devise发送邮件。 我已将以下内容添加到我的config / environments / development.rb文件中,但看起来邮件没有被发送。 注意:这适用于Google Apps,而非Gmail(但Gmail服务器应该可以使用 – 它们可以在我的邮件客户端中使用)。 我的配置中有什么东西跳出来的? config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => “smtp.gmail.com”, :port => 587, :domain => “mydomain.com”, :authentication => :login, :user_name => “myemaiL@mydomain.com”, :password => “mypass” }