Skip to content
Permalink
Browse files
Add files via upload
  • Loading branch information
fiuzadacua committed Apr 6, 2021
0 parents commit 7005d561170bcea2fffff01eb72cf7bc84922e82
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,20 @@
import openpyxl


def addSubscriber():
filename = "Subscribers.xlsx"
openFile = openpyxl.load_workbook("Subscribers.xlsx")
openSheet = openFile.active # gets the active sheet
initialRow = 2
emailAddress = input(str("What's the email address you would like to add?\nNew subscriber: "))

while openSheet.cell(row=initialRow, column=1).value is not None: # look for recipients on the excel sheet
if initialRow == 997: # statement to avoid reaching max depth
print("The maximum of recipients was exceeded! ")
break
else:
initialRow += 1

toString = 'A' + str(initialRow)
openSheet[toString] = emailAddress
openFile.save(filename)
@@ -0,0 +1,46 @@
from spammer import spammer # imports the function in spammer.py
from send_email import sendEmail # imports the function in send_email.py
from add_email import addSubscriber # imports the function in add_email.py
from quick_guide import quickGuide # imports the function in quick_guide.py
import time # imports time functions


def main():
print("\n== Main Menu =="
"\n1. Spammer"
"\n2. Send Email"
"\n3. Add subscriber"
"\n4. Quick Guide\n")
choice = str(input("Which option would you like to use?\nOption: "))
print("\n")
if choice == "1":
spammer()
time.sleep(2)
print("\n")
main()
if choice == "2":
sendEmail()
time.sleep(2)
print("\n")
main()
if choice == "3":
addSubscriber()
time.sleep(2)
print("\n")
main()
if choice == "4":
quickGuide()
time.sleep(2)
print("\n")
main()
else:
print("Invalid choice.\nPlease try again!")
time.sleep(2)
main()

return choice


if __name__ == '__main__':
mainMenu = main()
print(mainMenu)
@@ -0,0 +1,9 @@
def quickGuide():
print("Hello dear user, this is a quick guide on how to use the beta version of my email subscription/ spammer "
"bot.\nHere are the steps you will have to go through in order to work with my bot:\n\n->SETUP:\n1.Create "
"an Excel file named Subscribers.xlsx on the folder you saved the bot;\n2.Add up to 995 email addresses from "
"the cell A1 and below;\n3.Make sure you don't leave any blank cell in between email addresses or else it "
"won't be read.\n\n->OPTIONS:\n1.Spammer - Allows you to spam the email addresses on your excel sheet for "
"an amount of times of your own choice;\n2.Send email - Allows you to send an email with a subject and a "
"body to the emails on your Excel sheet;\n3.Add Subscriber - Type in the email address you wish to add to "
"the Excel spreadsheet.\n\nHope you enjoy it and make a good use of it!")
@@ -0,0 +1,30 @@
import openpyxl # import library to read excel files
import smtplib # library to login to gmail, send emails, etc...


def sendEmail():
sender = " " # email address for sender
password = " " # password for sender
openFile = openpyxl.load_workbook("Subscribers.xlsx")
openSheet = openFile.active # gets the active sheet
recipientsList = []
initialRow = 2
recipient = openSheet.cell(row=initialRow, column=1).value

while openSheet.cell(row=initialRow, column=1).value is not None: # look for recipients on the excel sheet
if initialRow == 997: # statement to avoid reaching max depth
print("The maximum of recipients was exceeded! ")
break
else:
initialRow += 1
recipientsList.append(recipient)

subject = str(input("What is the subject of the email?\nSubject: "))
message = str(input("What is the body of your message?\nBody: "))

smtp_sever = smtplib.SMTP_SSL("smtp.gmail.com", 465) # sets the server and the port
smtp_sever.login(sender, password) # login to account with email and pw
content = "Subject: {}\n\n{}".format(subject, message) # formats the email
smtp_sever.sendmail(sender, recipient, content) # send message

smtp_sever.close() # closes server/ disconnects
@@ -0,0 +1,45 @@
import openpyxl # import library to read excel files
import smtplib # library to login to gmail, send emails, etc...
import time # imports time functions


def spammer():
sender = " " # email address for sender
password = " " # password for sender
openFile = openpyxl.load_workbook("Subscribers.xlsx")
openSheet = openFile.active # gets the active sheet
recipientsList = []
initialRow = 2

while openSheet.cell(row=initialRow, column=1).value is not None:
recipient = openSheet.cell(row=initialRow, column=1).value
if recipient is None:
print("No more emails addresses were found.\nPlease ensure that there's no blank cell in between email "
"addresses!")
break
elif initialRow == 997:
print("The maximum of recipients was exceeded! ")
break
else:
initialRow += 1
recipientsList.append(recipient)

subject = str(input("What is the subject of the email?\nSubject: "))
message = str(input("What is the body of your message?\nBody: "))
numberOfEmails = int(input("How many times do you want to spam this email?\n== Be aware the limit is 100 == "
"\nSpam number: "))

smtp_sever = smtplib.SMTP_SSL("smtp.gmail.com", 465)
smtp_sever.login(sender, password)
content = "Subject: {}\n\n{}".format(subject, message)

if numberOfEmails > 995:
numberOfEmails = 995

while numberOfEmails > 0:
numberOfEmails -= 1
for recipient in recipientsList:
time.sleep(5) # avoids server disconnection from gmail
smtp_sever.sendmail(sender, recipient, content)

smtp_sever.close()

0 comments on commit 7005d56

Please sign in to comment.