New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gmail-oauth

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gmail-oauth

0.0.1
Rubygems
Version published
Maintainers
1
Created
Source

gmail-oauth

Implements Gmail OAuth access methods for Net::IMAP and Net::SMTP

Fully working examples (including fetching the access_token) for smtp and imap are in examples/

IMAP Usage

require 'gmail-oauth'
imap = Net::IMAP.new('imap.gmail.com',993,true)

# For 3legged oauth provide an OAuth::AcessToken
imap.authenticate('XOAUTH', "example@gmail.com", :access_token => access_token)

# For 2legged oauth just provide the OAuth::Consumer
#imap.authenticate('XOAUTH', "example@gmail.com", :consumer => consumer)

imap.list("*","*").each do |folder|
  puts folder.name
end

SMTP Usage

require 'gmail-oauth'

raw_email = generate_email()  

smtp = Net::SMTP.new('smtp.gmail.com')
smtp.enable_starttls
smtp.start('gmail.com', "example@gmail.com", {:access_token => access_token}, :xoauth)
smtp.send_message raw_email, "example@gmail.com", "destination@gmail.com"
smtp.finish

Copyright (c) 2010 Bob Potter. See LICENSE for details.

FAQs

Package last updated on 08 Jul 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts