gmail

https://github.com/gmailgem/gmail

Ruby

A Rubyesque interface to Gmail, with all the tools you'll need.

Gmail::Mailbox#emails

Returns list of emails which meets given criteria.

==== Examples

  gmail.inbox.emails(:all)
  gmail.inbox.emails(:unread, :from => "[email protected]")
  gmail.inbox.emails(:all, :after => Time.now-(20*24*3600))
  gmail.mailbox("Test").emails(:read)

  gmail.mailbox("Test") do |box|
    box.emails(:read)
    box.emails(:unread) do |email|
      ... do something with each email...
    end
  end

Source | Google | Stack overflow

Edit

git clone [email protected]:gmailgem/gmail.git

cd gmail

open lib/gmail/mailbox.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Gmail--Mailbox-emails-for-pr


# Commit to git

git add lib/gmail/mailbox.rbgit commit -m "better docs for Gmail::Mailbox#emails"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Gmail--Mailbox-emails-for-pr

hub pull-request


# Celebrate!