Created
January 8, 2013 14:49
-
-
Save gouf/4484320 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' | |
SERVER = 'pop.example.com' | |
ACCOUNT = '[email protected]' | |
PADDWORD = 'password' | |
PORT = 995 | |
# use APOP authentication if $isapop == true | |
pop = Net::POP3.APOP($isapop).new(SERVER, PORT) | |
pop.enable_ssl # enable SSL if need. | |
pop.start ACCOUNT, PASSWORD | |
if pop.mails.empty? | |
puts 'No mail.' | |
else | |
puts "You have #{pop.mails.length} new messages." | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment