imap mail fetching problem


S

ssljjfsf 123

HIII all
i am trying to fetch the emails of a perticular date...but i am getting some of the emails of a particular date not all the emails of that date...
my code is as follow


imap = Net::IMAP.new('imap.googlemail.com',993,true,nil,false)
imap.login('xyz','xyz')
imap.examine("INBOX")
imap.search(["SINCE","17-Aug-2012"]).each do |id|
email = imap.fetch(id, "BODY[]")[0].attr["BODY[]"]
mail = Mail.new(email)
puts "************date***************************"
puts mail.date.to_s
puts "************subject************************"
puts mail.subject
end
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top