IMAP + Ruby: How to search emails with multiple parameters with optional conditioning -
i have code using able fetch emails authenticated gmail account. @ moment there basic filter applied on it. requirement needs me apply multiple filters like:
[from: space@nasa.com]
, [subject: life on mars]
or [subject: life on venus]
, [subject "not": life on earth]
can when suggest how can apply filters on imap.search command?
you can try
imap.search(["from", "space@nasa.com", "subject", "life on mars", "or", "life on venus", "not", "life on earth"]) full documentation available here: http://www.ruby-doc.org/stdlib-2.0/libdoc/net/imap/rdoc/net/imap.html
Comments
Post a Comment