GMailer is a class for interface to Google's webmail service.

It can fetch mails, save attachements, get cotact lists, invite someone
or send message with file attachments. You can make GMail as an online
backup system or as a virtual filesystem with this library.

Now usage is very simple and compact like this:

GMailer.connect(name,pwd) do |g|
  #fetch
  g.fetch(:label=>"my_label") {|snapshot|
        puts "Total # of conversations of my_label = " +
snapshot.box_total.to_s
  }

  #get contact
  g.fetch(:contact=>"freq").each do |item|
    puts "Name: #{item['name']} Email: #{item['email']}"
  end

  #send
  g.send(
      :to => "whoo / foo.bar",
      :subj => "Hello There!",
      :body => "Hi...\n\nBlah blah blah~...",
      :files => ["./test.txt"]
   )

  # get labels
  labels = g.get_labels

  # get messages
  g.get_messages(:label=>labels[0]).each {|m|
     puts "Subject: #{m['subj']} / Snippet: #{m['snippet']}" if m['new?']
  }
end

Now you can connect with proxy server like this

GMailer.connect(:username=>name,:password=>pwd,
                        :proxy_host=>proxy,:proxy_port=>8080,
                        :proxy_user=>user,:proxy_pass=>pass) { |g|
    ...
}

But proxy connection needs some tests.

Project:: http://rubyforge.org/projects/gmailutils/
Bugs:: http://rubyforge.org/tracker/?group_id=869


Regards,

Park Heesob