banner
andrewji8

Being towards death

Heed not to the tree-rustling and leaf-lashing rain, Why not stroll along, whistle and sing under its rein. Lighter and better suited than horses are straw sandals and a bamboo staff, Who's afraid? A palm-leaf plaited cape provides enough to misty weather in life sustain. A thorny spring breeze sobers up the spirit, I feel a slight chill, The setting sun over the mountain offers greetings still. Looking back over the bleak passage survived, The return in time Shall not be affected by windswept rain or shine.
telegram
twitter
github

Python Email Group Advertising Machine

First, create four files: title.txt, content.txt, smtp.py, qq.txt.

image
In the title.txt file, place the email subject, for example:

image
In the content.txt file, place the email content, for example:

image
In the qq.txt file, place the email addresses to send to, for example:

image

smtp.py code#


import smtplib
from email.mime.text import MIMEText
from email.header import Header

while True:
    # Email login information
    email_user = 'your qq email'
    email_password = 'your authorization code'

    # Read recipient list
    with open('qq.txt', 'r') as file:
        recipient_list = file.readlines()

    # Remove trailing newline and whitespace from each recipient email address
    recipient_list = [recipient.strip() for recipient in recipient_list]

    # Read email body and subject
    with open('content.txt', 'r', encoding='utf-8') as file:
        body_text = file.read().strip()
    with open('title.txt', 'r', encoding='gbk') as file:
        title_text = file.read().strip()

    # Create email content
    msg = MIMEText(body_text, _subtype='html', _charset='utf-8')
    msg['From'] = email_user
    msg['Subject'] = Header(title_text.encode('utf-8'), 'utf-8').encode()

    # Connect to SMTP server
    with smtplib.SMTP_SSL('smtp.qq.com', 465) as server:
        server.login(email_user, email_password)

        # Send email to each recipient
        for recipient in recipient_list:
            try:
                server.sendmail(email_user, recipient, msg.as_string())
                print(f'[*] Email successfully sent to {recipient}')
            except smtplib.SMTPDataError as e:
                if e.smtp_code == 550:
                    print(f'[!] Failed to send email to {recipient}: {e.smtp_error}')
                elif e.smtp_code == 501:
                    print(f'[!] Failed to send email to {recipient}: Recipient address has syntax error')
                else:
                    print(f'[!] Error occurred while sending email: {e}')

    print('[*] All emails have been sent.')

    # Display prompt message and wait for user input of yes or no to determine whether to send more emails
    answer = input("Do you want to send emails again (yes/no)? ")

    # If user chooses "no", exit the program; otherwise, continue sending emails
    if answer.lower() == 'no':
        print("Program has been closed.")
        break
    else:
        continue

The prerequisite is to enable QQ Mail POP3, SMTP services, and obtain the service authorization code (password). It's the same for 163 Mail.
Login to QQ Mail official website: https://mail.qq.com/
After successful login/registration, go to the mailbox homepage and click on "Settings" on the left side.

image

Click on "Account".
image
Scroll down on the account page and find the content circled in red in the image, click to enable.

image
This string of characters is the authorization code.

image
Fill in the authorization code and email in the code block:

email_user = 'your qq email'
email_password = 'your authorization code'

Below is Python code to generate multiple emails:

import random
import string

def generate_random_email():
    domain = 'qq.com'
    username = ''.join(random.choices(string.ascii_letters + string.digits, k=8))
    email = username + '@' + domain
    return email

random_emails = []
for _ in range(100):
    random_emails.append(generate_random_email())

for email in random_emails:
    print(email)
# This code will generate 100 random QQ email addresses and print them out. The username of each email address is 8 characters long. You can customize the length of the username and the domain name of the email as needed.

This will generate 100 8-character QQ emails, and the generated emails will be saved in the qq.txt text file in the current directory.
Start sending emails in bulk, and if an email address doesn't exist, it will be skipped and the next one will be sent.

image

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.