End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Net::POPMail#delete
delete
lib/net/pop.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/net/pop.rb, line 858
def delete
@command.dele @number
@deleted = true
end
Marks a message for deletion on the server. Deletion does not actually occur until the end of the session; deletion may be cancelled for all marked messages by calling POP3#reset().
This method raises a POPError if an error occurs.
Example
Example
POP3.start('pop.example.com', 110, 'YourAccount', 'YourPassword') do |pop| n = 1 pop.mails.each do |popmail| File.open("inbox/#{n}", 'w') do |f| f.write popmail.pop end popmail.delete #### n += 1 end end