imap mail fetching problem

Discussion in 'Ruby' started by ssljjfsf 123, Aug 17, 2012.

  1. ssljjfsf 123

    ssljjfsf 123 Guest

    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
     
    ssljjfsf 123, Aug 17, 2012
    #1
    1. 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 (here). After that, you can post your question and our members will help you out.