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

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kapila Wijethilaka

    Web Mail client(IMAP)

    kapila Wijethilaka, Feb 16, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    1,159
  2. Henrik Ormåsen

    Curier-IMAP and imap.create()

    Henrik Ormåsen, Aug 19, 2006, in forum: Ruby
    Replies:
    0
    Views:
    357
    Henrik Ormåsen
    Aug 19, 2006
  3. Jon Fi
    Replies:
    4
    Views:
    1,000
    Kashia Buch
    Oct 21, 2006
  4. jasonnaylor
    Replies:
    1
    Views:
    424
    jasonnaylor
    Apr 16, 2008
  5. Adam Akhtar
    Replies:
    1
    Views:
    348
    Eric Hodel
    Dec 15, 2008
  6. Abhishiv Saxena

    Support for IMAP IDLE in net/imap

    Abhishiv Saxena, Jul 3, 2009, in forum: Ruby
    Replies:
    4
    Views:
    379
    Eric Hodel
    Jul 4, 2009
  7. Abhishiv Saxena

    Support for IMAP IDLE in net/imap

    Abhishiv Saxena, Jul 3, 2009, in forum: Ruby
    Replies:
    0
    Views:
    359
    Abhishiv Saxena
    Jul 3, 2009
  8. Tom Mac
    Replies:
    1
    Views:
    292
    Walton Hoops
    May 3, 2011
Loading...