dcparker / ruby-gmail

A Rubyesque interface to Gmail. Connect to Gmail via IMAP and manipulate emails and labels. Send email with your Gmail account via SMTP. Includes full support for parsing and generating MIME messages.
http://dcparker.github.com/ruby-gmail
792 stars 123 forks source link

Can't locate email using "subject" #66

Open seaman1 opened 10 years ago

seaman1 commented 10 years ago

gmail.inbox.emails(:subject => 'Email verification request') returns all inbox emails PS: not all of my inbox emails have subject 'Email verification request'.

nritholtz commented 10 years ago

+1

nritholtz commented 10 years ago

Actually for me, it was a silly mistake. I was using the latest gem '0.3.1', instead of master.

I fixed it by added gem 'ruby-gmail', git: 'git@github.com:dcparker/ruby-gmail.git', :ref => 'f8c2651f19' to the Gemfile.

@seaman1 I wonder if you by chance made the same mistake.

Viktova commented 6 years ago

solved by setting a filter in gmail for specific subjects and move them into a new label (mailbox) then set it as following:

gmail.mailbox('newlabelmailbox').emails(:unread)

this will return the mails that arent read and has a specific subject that we already filtered using gmail.