I am new to Ruby, I’m trying to return the number of emails between 9am and 11am.
For example.
@received_today = imap.search(["SINCE", @today.strftime("%d-%b-%Y-%H"):"BEFORE", @today.strftime("%d-%b-%Y-%H")]).count.to_s
I know this is wrong, but it’s my closest guess on how to do this. Any help would be highly appreciated.
Maybe something like this:
UPDATE:
Try #2 🙂
Since imap SEARCH command ignores the time part in SINCE and BEFORE conditions this should work: