dcparker/ruby-gmail

error with attachment

Closed this issue · 1 comments

hi there i have a problem with I tried to access to attachment file, this is my code

gmail.inbox.emails.each do |email|
  if !email.message.attachments.empty?
    email.attachments[0].save_to_file("~/")
  end
end

and this is the error that it throws

gems/mail-2.4.4/lib/mail/message.rb:1289:in `method_missing': undefined method `save_to_file' for #<Mail::Part:0x007ffca9a11d98> (NoMethodError)

The mail gem doesn't provide that method, so this was an error in the README. I've removed it, sorry about that.