0.0
No commit activity in last 3 years
No release in over 3 years
Implements Gmail OAuth access methods for Net::IMAP and Net::SMTP
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.0.0.beta.16

Runtime

>= 0
 Project Readme

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

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