├── README.md └── smtp-bulk.py /README.md: -------------------------------------------------------------------------------- 1 | # smtp-bulk-sender 2 | 3 | Send emails through smtp script , but this time in bulk , lets say you have 100 email and you need to send them the same letter , well i have got that covered :D 4 | 5 | Script is easy to use handy also follow the instruction i have mentioned in my script ! 6 | 7 | 8 | 9 | 10 | 11 | telegram me at : [itslucifero](https://t.me/itslucifero) 12 | 13 | Otherwise Enjot the tool and !!!!! My script is only for educational purposes !!!!! 14 | 15 | USE : 16 | 17 | python smtp-bulk.py 18 | 19 | 20 | -------------------------------------------------------------------------------- /smtp-bulk.py: -------------------------------------------------------------------------------- 1 | from email import message 2 | import smtplib, ssl 3 | from time import strftime 4 | import time 5 | from random import * 6 | from email.mime.multipart import MIMEMultipart 7 | from email.mime.text import MIMEText 8 | from email.message import EmailMessage 9 | from email.headerregistry import Address 10 | from email.header import Header 11 | import smtplib 12 | import colorama 13 | from colorama import Fore 14 | from colorama import * 15 | from datetime import datetime 16 | from datetime import date 17 | import os 18 | import platform 19 | platform.system() 20 | if platform.system() == 'Linux': 21 | 22 | clear = lambda: os.system('clear') 23 | else: 24 | clear = lambda: os.system('cls') 25 | 26 | 27 | #Took me 2 hours to get this shit done so unless u are adding some stuff dont fucking touch a shit 28 | 29 | today = date.today() 30 | print(Fore.RED + f""" 31 | 32 | SMTP Bulk Sender v 1.0.0 Coded By : 33 | 34 | mrhouse998 35 | Date : {today} 36 | Contact : https://t.me/itslucifero """) 37 | 38 | try: 39 | context = ssl.create_default_context() 40 | 41 | #variables tawa3na : 42 | print(f'\n[+]SETUP SMTP SERVER FIRST : ') 43 | smtp_server = input('Enter your smtp server HOST: ') 44 | smtp_port = input('Enter your SMTP port :') 45 | smtp_user = input('Please enter your SMTP USERNAME : ') 46 | smtp_pass = input('Enter your SMTP password : ') 47 | clear() 48 | print(Fore.RED +f""" 49 | 50 | SMTP Bulk Sender v 1.0.0 Coded By : 51 | mrhouse998 52 | Date : {today} 53 | Contact : https://t.me/mrhouse998 """) 54 | print(f'\n NOW THE LETTER PARTS : ') 55 | letter_subject = input(' Subject of letter : ') 56 | letter_path = input('Please Enter PATH TO letter HTML.txt : ') 57 | letter_From = input('Enter Letter FROM Name ( EX: Support ) : ') 58 | except KeyboardInterrupt: 59 | print("\nCTRL+C Detect, leaving :D") 60 | exit() 61 | #Fuction lewla njibou les emails men txt 62 | 63 | def get_contacts(filename): 64 | 65 | emails = [] 66 | with open(filename, mode='r', encoding='utf-8') as contacts_file: 67 | for a_contact in contacts_file: 68 | emails.append(a_contact.split()[0]) 69 | return emails 70 | 71 | mails = get_contacts(input('Enter Path To Mail List (PLEASE FILTER YOUR MAIL LIST) : ')) 72 | 73 | clear() 74 | 75 | print(Fore.GREEN + f""" 76 | 77 | SMTP Bulk Sender v 1.0.0 Coded By : 78 | mrhouse998 79 | Date : {today} 80 | Contact : https://t.me/mrhouse998 \n """) 81 | 82 | 83 | print(Fore.GREEN +'''##########################SENDING DONT PANIC###############################''') 84 | 85 | 86 | #2eme function de send 87 | def generate_messages(recipients): 88 | with open(letter_path, 'r') as myfile: 89 | data = myfile.read() 90 | 91 | for recipient in recipients: 92 | message = EmailMessage() 93 | message['Subject'] = letter_subject 94 | message['From'] = Address(letter_From, *smtp_user.split("@")) 95 | message['To'] = recipient 96 | message.set_content(data, 'html') 97 | yield message 98 | 99 | 100 | 101 | def smtp(smtp_server, port, user, password, messages): 102 | try: 103 | 104 | if port == '587': 105 | 106 | with smtplib.SMTP(smtp_server, port) as server: 107 | 108 | try: 109 | 110 | server.login(user, password) 111 | print(Fore.GREEN + 112 | f'''\n\n\nSMTP CONNECTION ESTABLISHED :\n SERVER : {smtp_server}\n User: {user}\n Pass: {password}\n PORT : {port} \n NO CONNECTION ERRORS! \n Wish with me no other erors haha ''') 113 | for message in messages: 114 | now = datetime.now() 115 | time.sleep(5) 116 | server.send_message(message) 117 | 118 | 119 | print(Fore.GREEN +'\n[+]', message['To'] + f''' SENT! {time.strftime('%X')}''') 120 | print(Fore.GREEN +'''\n ###################################################################### SENT''') 121 | 122 | 123 | 124 | 125 | except smtplib.SMTPException: 126 | print(Fore.RED +'SMTP DIED OR DEAD [-] Error: unable to send email') 127 | elif port == '465': 128 | with smtplib.SMTP_SSL(smtp_server, port) as server: 129 | 130 | try: 131 | 132 | server.login(user, password) 133 | print(f'''\n\n\nSMTP CONNECTION ESTABLISHED :\n SERVER : {smtp_server}\n User: {user}\n Pass: {password}\n PORT : {port} \n NO CONNECTION ERRORS! \n Wish with me no other erors haha ''') 134 | for message in messages: 135 | now = datetime.now() 136 | current_time = now.strftime("%H:%M:%S") 137 | time.sleep(5) 138 | server.send_message(message) 139 | 140 | print(Fore.GREEN +'\n[+]', message['To'] + f''' SENT! {time.strftime('%X')}''') 141 | print(Fore.GREEN +'''\n ###################################################################### SENT''') 142 | 143 | 144 | except smtplib.SMTPException: 145 | print(Fore.RED +'SMTP DIED OR DEAD [-] Error: unable to send email') 146 | 147 | 148 | else: 149 | print('wrong PORT') 150 | except KeyboardInterrupt: 151 | print("CTRL+C Detect, leaving :D") 152 | exit() 153 | 154 | try: 155 | smtp(smtp_server=smtp_server, port=smtp_port, user=smtp_user, password=smtp_pass, messages=generate_messages(mails)) 156 | except KeyboardInterrupt: 157 | print('\nCTRL + C DETECTED LEAVING') 158 | exit() 159 | --------------------------------------------------------------------------------