Rails 获取邮箱中所有邮件

require 'net/pop'

mail_server = Net::POP3.new('mail.mailservernamehere.com')//连接
mail_server.start('username','password')//认证

mail_server.mails.each do |m|
  mail = m.pop
  puts mail
end

编程技巧