#!/usr/bin/python import sys, poplib, smtplib if __name__=="__main__": print sys.argv if len(sys.argv) <= 1: print "usage: ", sys.argv[0], " mailhost" sys.exit(1) # get the hostname hostname = sys.argv[1] # get the username username = raw_input("Username:") # geth the password passwd = raw_input("Password:") # open a connection print "Opening POP3 connection ...." c = poplib.POP3(hostname) c.user(username) c.pass_(passwd) # close it again c.quit() print "POP3 connection worked !"