Created
June 8, 2010 13:08
-
-
Save dnch/429978 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'net/imap' | |
| imap = Net::IMAP.new("imap.gmail.com", { :ssl => true }) | |
| imap.login("username", "password") | |
| imap.status("INBOX", ["UNSEEN"]) | |
| imap.select("INBOX") | |
| imap.search(["UNSEEN"]) # => message ids | |
| t = imap.fetch(message_id, "RFC822").first.attr["RFC822") # => whole message in RFC822 | |
| Mail.new(t) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment