We then should the same thing with the server, protocol, and port number. If you use this code for only one server, you can hardwire the values into the program, otherwise, you need to go back to the user:
server = raw_input('Server Address:')We then need to follow this with an if loop to set the value for the mailbox object:
type = raw_input('Encrypted with SSL (Y/N):')
port = raw_input('Port:')
if type=="Y":This bit of code obviously expects the user to know the port number involved. With another if loop, however, one can allow for custom ports and defaults. POP3 defaults to port 110. POP3 over SSL (POP3_SSL) defaults to port 995.
Mailbox = poplib.POP3_SSL(server, port)
else:
Mailbox = poplib.POP3(server, port)
