import smtplib import sys try: print "-----------------++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------" print "-----------------++++++++++++++++++++++++++++++++++++++--shahroze bulk email sender--++++++++++++++++++++++++++++++++++++++++++-----------------" print "-----------------++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------" # get the txt file containing the email addresses of recepients. Each email is written on a separate line # for example # [You must be registered and logged in to see this link.] # [You must be registered and logged in to see this link.] # and so on users = raw_input("\n[email sender] recepients file name: ") if ".txt" in users: pass else: print "[email sender] this is not a valid txt file" sys.exit() # get the list of recepients recepients = [] try: with open(users) as i: user_list = i.readlines() for i in user_list: recepients.append(i.strip("\n")) except IOError : print "[email sender] invalid recepients file" sys.exit() # get the required information from the user FROM = raw_input("[email sender] from: ") TO = recepients SUBJECT = raw_input("[email sender] subject: ") TEXT = raw_input("[email sender] message: ") # Prepare actual message headers = ["From: " + FROM, "Subject: " + SUBJECT, "To: " + ", ".join(TO), "MIME-Version: 1.0", "Content-Type: text/html"] headers = "\r\n".join(headers) body = "" + TEXT + "" # Credentials username = raw_input("[email sender] your gmail username: ") password = raw_input("[email sender] your gmail password: ") if "gmail.com" in username: host = "smtp.gmail.com:587" elif "ymail.com" in username: host = "smtp.ymail.com:587" elif "live.com" in username: host = "smtp.live.com:587" print "[email sender] SMTP configuration is set to %s"%host # The actual mail send print "[email sender] sending....." server = smtplib.SMTP(host) server.starttls() server.login(username,password) server.sendmail(FROM, TO, headers + "\r\n\r\n" + TEXT) server.quit() print "[email sender] email sent to all recepients"
Bulk email sender
Admin- Admin
- Posts : 474
Reputation : 8
Join date : 2014-12-10
Age : 32
Location : Pakistan
- Post n°1
Sat Apr 29, 2017 10:50 am by ubedullah
» Group hackers
Sat Apr 15, 2017 2:37 pm by Group Hackers
» Hacker Needed
Sat Apr 15, 2017 3:57 am by Group Hackers
» Hacker Needed
Sat Apr 15, 2017 1:45 am by Group Hackers
» Hacker Needed
Thu Apr 13, 2017 11:10 pm by Group Hackers
» Hacker Needed
Tue Apr 11, 2017 2:07 pm by Group Hackers
» Hacker Needed
Tue Apr 11, 2017 2:21 am by Group Hackers
» Hacker Needed
Tue Apr 11, 2017 2:06 am by Group Hackers
» Hacker Needed
Tue Apr 11, 2017 1:35 am by Group Hackers