1

我在这里询问如何在 python 线程中提供延迟以及一次发送电子邮件的数量。让我们举一个这样的例子我想大量发送电子邮件,但另一方面我也想在一次发送中提供电子邮件的最大限制,并且我想在一次发送中延迟让我们举一个我想要的例子发送电子邮件时,该工具将在 5 秒后自动延迟 5 秒,然后该工具将再次运行,直到所有电子邮件都发送完毕。下面在这里我做了一个延迟系统和一次发送的电子邮件数量,但我仍然怀疑当延迟是这个工具仍然运行时,即使有延迟写入,以及系统的电子邮件数量在一个发送发送不正确或不规则,您可以说随机不符合预期

from inc.api3 import *
from time import sleep
import threading


clear(system_eck())  # Clean  Command
print(logo("DSWEB19778", time.asctime(), "6.0",
  "APPLE-API", "https://paypal.me/wecandoittogheter"))  # Logo COpyRights


if __name__ == "__main__":

    try:

        ask = input(genta+"    MailList #> ")
        prox = input(genta+"    ProxyList #> ")
        mod = "r+"
        op = open(ask, mod).readlines()
        listo = len(op)
        print("    Rzlt Folder Checking...")
        flr = rzlt_folder()
        if flr == True:
            print("    - Already Exist.")
        else:
            print("    - Creating Folder. Done")
            print("    List: "+red+str(listo)+"\n")

        delay = 0
        for fr in op:
        
            x = fr.strip("\n")
            delay += 1
            if delay == 25:
                sleep(10)
                print(blue+"    [+] ------------- Waiting -------------")
                delay = 0
                continue
            else:
                pass
            t = threading.Thread(target=apple_api, args=(x,prox))
            t.start()
        

    except IOError as err:
        print("    ERROR -> "+str(err))
        exit()
    except EOFError as err:
        print("    ERROR -> "+str(err))
        exit()
    except IndexError as err:
        print("    ERROR -> "+str(err))
        exit()
    except KeyError as err:
        print("    ERROR -> "+str(err))
        exit()
    except KeyboardInterrupt as err:
        print("    [KILLED] By user")
        exit()
4

0 回答 0