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

error with attachment #40

Closed chebyte closed 11 years ago

chebyte commented 12 years ago

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)
myobie commented 11 years ago

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