I retrieve mail using net/pop , but I also need to parse through the email to obtain subject,from address and email body. Any ideas with Action Mailer? I'm supposed to use 3rd party gems.(No,not even Tmail)
require 'rubygems'
require 'net/pop'
require 'pop_ssl'
Net::POP3.enable_ssl(OpenSSL::SSL::VERIFY_NONE)
def pull_mail
Net::POP3.start("pop.gmail.com", 995, "uname","pass") do |pop|
if pop.mails.empty?
puts 'No mails.'
else
pop.each_mail do |mail|
puts mail_header
end
end
end
Cheers!