I'm using the mail API as so:

require 'yaml'
require 'net/imap'
require 'mail'

yaml = File.open( "/home/thufir/ruby/email.yml" )
email = YAML.load_file( yaml )

server = email["server"]
user = email["user"]
password = email["password"]

puts server
puts user
puts password

imap = Net::IMAP.new(server)
puts "connected"
imap.login(user,password)
puts "logged in"
imap.select('INBOX')
mailIds = imap.search(['ALL'])
mailIds.each do |id|
  puts 'ok'
  msg = imap.fetch(id,'RFC822')[0].attr['RFC822']
  mail = Mail.new(msg)
  subj = mail.subject   # HERE'S THE SUBJECT FROM THE HEADER
  puts subj
end
imap.logout()
imap.disconnect()

and have no problem getting the subject header, that's all good. How do I get the other headers? Or a Hash of headers? Non-standard headers.



thanks,

Thufir

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to