Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.36 KB | None | 0 0
  1. gmail.inbox.find(:unread).each do |mail|
  2.     mail_subject = mail.subject
  3.    
  4.     mail_subject = mail_subject.encode('UTF-8', invalid: :replace, undef: :replace)
  5.  
  6.     mail_body = mail.text_part.body.decoded
  7.  
  8.     mail_body = mail_body.encode('UTF-8', invalid: :replace, undef: :replace)
  9.  
  10.     mail_sender = mail.from.last.mailbox + "@" + mail.from.last.host
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement