Guest User

Untitled

a guest
Jul 16th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. require 'net/imap'
  2.  
  3. imap = Net::IMAP.new('outlook.office365.com', ssl: true)
  4. begin
  5. imap.authenticate('PLAIN', 'user', 'pass')
  6. rescue
  7. abort 'Auth failed'
  8. end
  9. imap.select('INBOX')
  10.  
  11. ids = imap.search(["UNSEEN"])
  12. puts ids.size
Add Comment
Please, Sign In to add comment