Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Email Spammer [ SIMPLE ]

Hello again, I made a simple email spammer. It may have errors, but so far its running good.

[ tested with safe sending setting with cloud servers, so far no errors ]

If have any thing to get update or even new ideas, let me know. I'm still in intermediate level in my course. Love to learn more things new way 🙃

Note: - I scraped some list of quotes, and made txt file and put it in the same directory to get what to send in as email. Also can use API if wanted, but in this case used simple quotes from txt file. 😁


Code
import smtplib
import time
import random

MY_EMAIL = "YOUR EMAIL" # Gmail works best
MY_PASSWORD = "YOUR PASSWORD" # Use generated app password


def send_email(message, subject):
    with smtplib.SMTP_SSL("smtp.gmail.com", 465) as connection:
        connection.ehlo()
        connection.login(MY_EMAIL, MY_PASSWORD)
        connection.sendmail(from_addr=MY_EMAIL,
                            to_addrs="YOUR VICTIM EMAIL", # Enter your victim email
                            msg=f"Subject:Hey Name, {subject}...\n\n{message}")


def call_me():
    with open("quotes.txt") as quotes:
        my_quotes = quotes.readlines()
        send_quote = random.choice(my_quotes)
        send_subject = send_quote[:15]
    send_email(message=send_quote, subject=send_subject)


def countdown(t):
    while t:
        mins = t // 60
        secs = t % 60
        timer = '{:02d}:{:02d}'.format(mins, secs)
        print(timer, end="\r")
        time.sleep(1)
        t -= 1
    print('Lets Try Again!!!')


count = 0


def counter():
    count_print = f"[+]___ {str(count)} mail sent!!"
    return print(count_print, end='\r')


while True:
    time.sleep(60)
    try:
        call_me()
        count += 1
        counter()
    except Exception:
        print(f"Let me take a brake")
        time.sleep(3600)
        countdown(3600)
I do believe Google has a limit of 500 email per day if you send out from an account but don't limit the messages per minute so the time delays in your script are a little long and unnecessary. Also I would open the quotes.txt first before the while loop and pass in a list of the quotes and work from there so that your not constantly opening a file which may reduce run times.


Good script though!
(May 14, 2021 08:18 PM)Flash7475 Wrote:  I do believe Google has a limit of 500 email per day if you send out from an account but don't limit the messages per minute so the time delays in your script are a little long and unnecessary. Also I would open the quotes.txt first before the while loop and pass in a list of the quotes and work from there so that your not constantly opening a file which may reduce run times.


Good script though!


First thank for your compliment. 🙂

I tested and there is total 1000 email sent out per day. After i stopped script in cloud.

About open the quotes.txt thing, you mean not to use it inside function ? If so, it cannot make random quotes for each email, without called it again in loop. What i miss there ?

I made this for make a fun to my friend email, so I didn't wanted to send all possible emails at once and limited time. That's why I added time delay, and guessing the gmail have 1000 mails per day, so added 2 min between each email. That will make my friend email load each 2 min all the day. 😁

Also It be good to add random time delay, on that sleep.. It will make more fun and random time in each email.. hmm


(May 14, 2021 09:53 PM)forfeit Wrote:  Sleep timer is unnecessarily long.


As i said, it just for setting, can change and or even remove. 🙂
I wouldn't use googles smtp for spamming, set up your own.
For Spamming sender best for inbox its
Bug Sender
and 4k Dracos for me 100/100 inbox with any smtp!


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by SIM-4910684Oct 7, 2021 04:35 PM 7 277 Oct 7, 2021 04:35 PM
Last Post: hackhim
[Shell] by decendedJan 22, 2018 03:09 AM 1 204 Jan 22, 2018 03:09 AM
Last Post: Sir-Teabag
[.NET] by EffexionNov 11, 2017 12:58 PM 8 912 Nov 11, 2017 12:58 PM
Last Post: Effexion