Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: ssljjfsf 123 Newsgroups: comp.lang.ruby Subject: imap mail fetching problem Date: Fri, 17 Aug 2012 05:14:51 -0700 (PDT) Organization: http://groups.google.com Lines: 16 Message-ID: NNTP-Posting-Host: 115.248.175.50 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1345209343 15133 127.0.0.1 (17 Aug 2012 13:15:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 17 Aug 2012 13:15:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=115.248.175.50; posting-account=DpwtugoAAABpQ8GrHVj-0UZXwPI2LAOO User-Agent: G2/1.0 Xref: csiph.com comp.lang.ruby:6600 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