Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Net::POP3.auth_only

auth_only(address, port = nil, account = nil, password = nil, isapop = false)

Opens a POP3 session, attempts authentication, and quits.

This method raises POPAuthenticationError if authentication fails.

Example: normal POP3

Example
Net::POP3.auth_only('pop.example.com', 110,
                    'YourAccount', 'YourPassword')

Example: APOP

Example
Net::POP3.auth_only('pop.example.com', 110,
                    'YourAccount', 'YourPassword', true)