Guest User

How to get the body

a guest
Jul 6th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. pop.mails.each do |mail|
  2.  
  3. fileData = mail.pop
  4.  
  5. headers, body = fileData.split(/\r\n\r\n/, 2)
  6. bodyTrash, bodyContent = body.split(/\r\n\r\n/,2)
  7. bodyContent, bodyTrash = bodyContent.split(/\r\n\r\n/,2)
  8. File.write("newbody.txt", bodyContent)
  9. subject = mail.header.split("\r\n").grep(/^Subject:/)
Advertisement
Add Comment
Please, Sign In to add comment