Created
September 22, 2015 19:38
-
-
Save le0pard/e3e3dd4f243fe80307cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/pop' | |
raise "args shoud be email ans pass" if ARGV.length < 2 | |
username, password = ARGV[0], ARGV[1] | |
Net::POP3.start('mailtrap.io', 1100, username, password, true) do |pop| | |
if pop.mails.empty? | |
puts 'No mail.' | |
else | |
pop.each_mail do |m| | |
puts m.pop | |
m.delete | |
end | |
puts "#{pop.mails.size} mails popped." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment