how to provide delay, the number of requests in one send?

77 Views Asked by At

I'm here to ask how to provide delay and also the number of sending emails at a time in python threading. let's take an example like this I want to send emails in large quantities but on the other hand I also want to provide a maximum limit of emails in one send, and also I want to give a delay in one send let's take an example I want when the email is sent the tool will automatically delay in 5 seconds after 5 seconds then the tool will run again until so on until all emails are sent. below here I have made a delay system and the number of emails in one send, but I still doubt that when the delay is this tool is still running even though there is a delay written, and also for the system the number of emails in one send is not correct or irregular, you could say random not as expected

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()
0

There are 0 best solutions below