Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rubypop [2014/10/26 01:52] (current)
Line 1: Line 1:
 +==== Ruby POP3 ====
 +<code lang=ruby>​
 +require '​net/​pop'​
 +pop = Net::​POP3.new('​mail.mnain.org'​)
 +pop.start('​junk@mnain.org',​ '​********'​) do |pop|
 +  puts "# msgs : #​{pop.mails.size}"​
 +  pop.mails.each { |msg|
 +
 +  # Print the '​From:'​ header line
 +  puts msg.header.split("​\r\n"​).grep(/​^From:​ /)
 +
 +  # Put message to $stdout (by calling <<)
 +  #puts "​\nFull message:​\n"​
 +  #msg.delete
 +  }
 +end
 +</​code>​
 +
 +----
 +
 +  * [[rubyinfo|Back to Ruby]]
  
rubypop.txt ยท Last modified: 2014/10/26 01:52 (external edit)
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0