Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'net/imap'
- imap = Net::IMAP.new('outlook.office365.com', ssl: true)
- begin
- imap.authenticate('PLAIN', 'user', 'pass')
- rescue
- abort 'Auth failed'
- end
- imap.select('INBOX')
- ids = imap.search(["UNSEEN"])
- puts ids.size
Add Comment
Please, Sign In to add comment