class Net::POPMail
not be directly created by the user.
Instances of this class are created by the POP3 class; they should
This class represents a message which exists on the POP server.
def delete
end
end
n += 1
popmail.delete ####
end
f.write popmail.pop
File.open("inbox/#{n}", 'w') do |f|
pop.mails.each do |popmail|
n = 1
'YourAccount', 'YourPassword') do |pop|
POP3.start('pop.example.com', 110,
=== Example
This method raises a POPError if an error occurs.
cancelled for _all_ marked messages by calling POP3#reset().
actually occur until the end of the session; deletion may be
Marks a message for deletion on the server. Deletion does not
def delete @command.dele @number @deleted = true end
def deleted?
def deleted? @deleted end
def header(dest = +'')
The optional +dest+ argument is obsolete.
Fetches the message header.
def header(dest = +'') top(0, dest) end
def initialize(num, len, pop, cmd) #:nodoc:
def initialize(num, len, pop, cmd) #:nodoc: @number = num @length = len @pop = pop @command = cmd @deleted = false @uid = nil end
def inspect
def inspect +"#<#{self.class} #{@number}#{@deleted ? ' deleted' : ''}>" end
def pop( dest = +'', &block ) # :yield: message_chunk
This method raises a POPError if an error occurs.
end
end
n += 1
end
end
f.write chunk
popmail.pop do |chunk| ####
File.open("inbox/#{n}", 'w') do |f|
pop.mails.each do |popmail|
n = 1
'YourAccount', 'YourPassword') do |pop|
POP3.start('pop.example.com', 110,
=== Example with block
end
end
n += 1
popmail.delete
end
f.write popmail.pop
File.open("inbox/#{n}", 'w') do |f|
pop.mails.each do |popmail|
n = 1
'YourAccount', 'YourPassword') do |pop|
POP3.start('pop.example.com', 110,
=== Example without block
argument is essentially obsolete.
+dest+ argument will be prepended to the returned String; this
without a block, the message is returned as a String. The optional
message is yielded to the block one chunk at a time. If called
This method fetches the message. If called with a block, the
def pop( dest = +'', &block ) # :yield: message_chunk if block_given? @command.retr(@number, &block) nil else @command.retr(@number) do |chunk| dest << chunk end dest end end
def top(lines, dest = +'')
The optional +dest+ argument is obsolete.
Fetches the message header and +lines+ lines of body.
def top(lines, dest = +'') @command.top(@number, lines) do |chunk| dest << chunk end dest end
def uid=(uid) #:nodoc: internal use only
def uid=(uid) #:nodoc: internal use only @uid = uid end
def unique_id
Normally the unique-id is a hash string of the message.
Returns the unique-id of the message.
def unique_id return @uid if @uid @pop.set_all_uids @uid end