zoukankan      html  css  js  c++  java
  • python实战===使用随机的163账号发送邮件

    import linecache
    import smtplib
    import time
    import linecache
    import random
    
    
    #算出txt的行数,163账号_2.txt中,每一行都存储一个账号密码!
    txt = open(r'F:163账号_2.txt','r') data = txt.read() txt.close() n = data.count(' ') print("总行数",n) #选取随机的数 i = random.randint(1, (n+1)) print("本次使用的行数",i) print("===========================") ###得到对应的i行的数据 line=linecache.getline(r'F:163账号_2.txt',i) #切片实现分离出账号和密码 user = line.split("----")[0] password = line.split("----")[1].replace(' ','') print(user) print(password) try: #发送邮箱的账号/密码 smtpserver = "smtp.163.com" smtp = smtplib.SMTP() smtp.connect(smtpserver) smtp.login(user,password) print("邮箱登陆成功!") print("",(i-1),"行账号有效") time.sleep(1) except: print("邮箱登陆失败,请重新输入!") time.sleep(1)

    *这样虽然可以实现163邮箱的登录,但是可能会被锁定ip

    *备注账号文档在上传的文件:163账号_2.rar

  • 相关阅读:
    win7与centos虚拟机的共享文件夹创建
    MySQL视图
    MySQL分区表与合并表
    PHP读写XML文件的四种方法
    备份与恢复
    MySQL日志
    MySQL锁问题
    优化数据库对象
    ActiveReport资料
    对ArrayList 进行深拷贝
  • 原文地址:https://www.cnblogs.com/botoo/p/7274787.html
Copyright © 2011-2022 走看看