F
Frioffol Friofool
Hello,
I'm trying to do a method to get mail via pop3 server.
I created the following script but i receive this message during
executio :
testmail.rb:12: undefined method `mails' for #<Net:
OPMail 1>
(NoMethodError)
#!/usr/bin/env ruby
require 'net/pop' # I renamed the file from pop.rb to pop_ssl.rb to
ensure I was requiring the correct version
username = '(e-mail address removed)'
password = 'pass'
#Net:
OP3.enable_ssl(OpenSSL::SSL::VERIFY_NONE)
conn = Net:
OP3.new('pop.host.com',110)
conn.start(username,password)
conn.mails.each do |pop|
msg = pop.mails[0]
# Print the 'From:' header line
puts msg.header.split("\r\n").grep(/^From: /)
# Put message to $stdout (by calling <<)
puts "\nFull message:\n"
msg.all($stdout)
end
maybe a lib problem ?
thx for your answer...
I'm trying to do a method to get mail via pop3 server.
I created the following script but i receive this message during
executio :
testmail.rb:12: undefined method `mails' for #<Net:
(NoMethodError)
#!/usr/bin/env ruby
require 'net/pop' # I renamed the file from pop.rb to pop_ssl.rb to
ensure I was requiring the correct version
username = '(e-mail address removed)'
password = 'pass'
#Net:
conn = Net:
conn.start(username,password)
conn.mails.each do |pop|
msg = pop.mails[0]
# Print the 'From:' header line
puts msg.header.split("\r\n").grep(/^From: /)
# Put message to $stdout (by calling <<)
puts "\nFull message:\n"
msg.all($stdout)
end
maybe a lib problem ?
thx for your answer...