Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enter any key to exit
- enter 'spam' to spam an email
- Enter: spam
- Running..Running..Running..Running..Running..Running..Running..Traceback (most recent call last):
- File "C:UsersLeonDesktopProgettiGdazeGdaze.py", line 61, in <module>
- emailSetupAndGo(getData()[0], getData()[1], getData()[2], getData()[3], getData()[4], getData()[5])
- File "C:UsersLeonDesktopProgettiGdazeGdaze.py", line 46, in emailSetupAndGo
- server = smtplib.SMPT('smtp.gmail.com:587')
- AttributeError: module 'smtplib' has no attribute 'SMPT'
- import smtplib
- import sys
- def getData():
- #GETTING DATA FROM THE FILE
- configFile = open('config.txt', 'rt')
- usernameLine = configFile.readline()
- passwordLine = configFile.readline()
- nLine = configFile.readline()
- fromemailLine = configFile.readline()
- toemailLine = configFile.readline()
- msgLine = configFile.readline()
- configFile.close()
- if "<yourgmail's>" in usernameLine:
- sys.stderr.write("NoSettings ERROR: modify the config.txt file before you run the program.")
- elif "<yourgmail's>" in passwordLine:
- sys.stderr.write("NoSettings ERROR: modify the config.txt file before you run the program.")
- elif "<int>" in nLine:
- sys.stderr.write("NoSettings ERROR: modify the config.txt file before you run the program.")
- elif "<youremail>" in fromemailLine:
- sys.stderr.write("NoSettings ERROR: modify the config.txt file before you run the program.")
- elif "<emailtospam>" in toemailLine:
- sys.stderr.write("NoSettings ERROR: modify the config.txt file before you run the program.")
- elif "<msg>" in msgLine:
- sys.stderr.write("NoSettings ERROR: modify the config.txt file before you run the program.")
- else:
- sys.stdout.write("Running..")
- #DECLARING THE MAIN VARIABLES
- u = str(usernameLine[11:])
- pw = str(passwordLine[11:])
- n = str(nLine[27:])
- fromemail = str(fromemailLine[12:])
- toemail = str(toemailLine[10:])
- msg = str(msgLine[10:])
- #DELETING SPACES IN THE FILE TO STORE CORRECTLY THE DATA
- u.split(" ")
- pw.split(" ")
- n.split(" ")
- fromemail.split(" ")
- toemail.split(" ")
- msg.split(" ")
- data = [u, pw, n, fromemail, toemail, msg]
- return data
- def emailSetupAndGo(n, username, password, fromemail, toemail, message):
- server = smtplib.SMPT('smtp.gmail.com:587')
- server.starttls()
- server.login(username, password)
- for i in n:
- server.sendmail(fromemail, toemail, message)
- server.quit()
- def help():
- sys.stdout.write("enter any key to exitnenter 'spam' to spam an emailn")
- while True:
- help()
- entered = input("Enter: ")
- if entered == 'spam':
- getData()
- emailSetupAndGo(getData()[0], getData()[1], getData()[2], getData()[3], getData()[4], getData()[5])
- else:
- break
- username = <yourgmail's>
- password = <yourgmail's>
- number of emails to spam = <int>
- fromemail = <youremail>
- toemail = <emailtospam>
- message = <msg>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement