Retrieve Gmail using Ruby
- by Kartik Rao
I need to retrieve emails from my Gmail account using Ruby on Rails. I'm currently using this piece of code, but it gives me a timeout error everytime.
require 'net/pop'
pop = Net::POP3.new 'mail.isp.com'
pop.start 'username@isp.com', 'password'
if pop.mails.empty?
puts "No mail."
else
puts "You have #{pop.mails.length} new messages."
…