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)

save_to_file is not a method of Mail::Part so that is an error in the README. I apologize for this and I'll try to add a better example. If you did manage to get this to work then please fork and update the README, thanks.