Last active
October 8, 2019 14:24
-
-
Save powerexploit/43ce31014b3c0663d76d67ead4edba2c to your computer and use it in GitHub Desktop.
This is a mass mailer script which helps to send multiple mails at one time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#mass_mailer.py -> mass mailing script | |
import smtplib | |
def mass(): | |
smtpobj = smtplib.SMTP('smtp.gmail.com',587) | |
#smtpobj is a SMTP object that represents a connection to an SMTP mail server and has methods for sending emails. | |
my_email = input("What is your gmail?:") | |
my_passw = input("Enter the password:") | |
recip_mail = input("What is the recipient gmail?:") | |
message = input("Enter the message that you want to mail:\n") | |
times = int(input("How many times do you want to mail?")) | |
smtpobj.starttls() #This step enables encryption(TLS Encryption) for your connection. | |
try: | |
smtpobj.login(my_email,my_passw) | |
#this will help user to loged in gmail account | |
except smtplib.SMTPAuthenticationError: | |
print("Change setting in your account to login in your account") | |
for i in range(0,times): | |
i=i+1 | |
smtpobj.sendmail(my_email,recip_mail,message) | |
#sendmail() will help user to send mail to recipent user. | |
print("mail sended",i,"times...") | |
print("Lets quit:\n",smtpobj.quit()) | |
#it will close your connection | |
mass() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment