Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def receive_mail
- require 'net/imap'
- host = 'imap.gmail.com'
- port = '993'
- ssl = true
- username = ''
- password = ''
- mailbox = 'INBOX'
- # Configs
- # Here's what I would like to have
- config = { :unread => "'NOT', 'SEEN'" }
- imap = Net::IMAP.new(host, port, ssl)
- imap.login(username, password)
- # Select the mailbox to view
- imap.select(mailbox)
- # Find all mail give the filter provided
- imap.search([config[:unread], :before=>'0101010', :marked=>'star']) do |message_id|
- end
Add Comment
Please, Sign In to add comment