This is a Python-based SMTP mailer tool designed for educational purposes. It allows you to send spoofed emails through an SMTP server by providing the necessary SMTP configuration (server, port, login, password) and email details (from address, to address, subject, message). The script supports both plain text and HTML email content.
- Send spoofed emails using any SMTP server (e.g., Gmail, Yahoo, etc.)
- Option to include HTML content in the email π
- Logs all sent emails to a file for record-keeping π
- Handles common SMTP errors (authentication, connection issues, etc.)
β οΈ - Simple CLI interface with color-coded outputs for success and error messages π¨
- Python 3.x
termcolor
andcolorama
for colored terminal output π¨smtplib
for sending emails (usually comes with Python by default)
termcolor
colorama
smtplib
(usually included in Python)
Before using the tool, make sure the necessary Python modules are installed. You can install them using the following commands:
pip install termcolor colorama
The script automatically installs missing modules when executed. π§
Clone this repository or download the script spoofer.py
.
If you wish to send an HTML email, create an HTML file called msg.html
in the same directory as the script. The script will automatically read this file when prompted to send HTML content. Example:
<!-- msg.html -->
<html>
<body>
<h1>This is a spoofed email!</h1>
<p>This is the HTML content of the email.</p>
</body>
</html>
Execute the script from the terminal or command prompt:
python spoofer.py
The script will prompt you for the following inputs:
- SMTP Server: The SMTP server address (e.g., smtp.gmail.com).
- SMTP Port: The SMTP port number (commonly 25, 465, or 587).
- SMTP Username: Your email or username used to authenticate with the SMTP server.
- SMTP Password: Your SMTP password (input will be hidden).
- From Address: The email address you want to spoof.
- To Address: The recipient email address.
- Subject: The subject of the email.
- Message: The plain text body of the email.
- HTML Content: Choose whether to include HTML content. If you answer
yes
, the script will automatically look foremail_content.html
in the same directory.
SMTP Server (e.g., smtp.gmail.com): smtp.gmail.com
SMTP Port (e.g., 587): 587
Your SMTP Username (can be email or username): [email protected]
Your SMTP Password: ********
Spoofed 'From' Address (e.g., [email protected]): [email protected]
Recipient Email Address: [email protected]
Email Subject: Test Email
Email Message (plain text): This is a test email.
Do you want to include HTML content? (yes/no): yes
The script logs all sent emails in a file called email_log.txt
in the current directory. Each log entry includes the time, sender, recipient, subject, and message content.
- Authentication Failed: Ensure your SMTP username and password are correct. π
- Connection Error: Verify the SMTP server address and port. π
- HTML File Missing: If you choose to include HTML content but don't have an
email_content.html
file in the same directory, the script will notify you. π
This tool is intended for educational purposes only. Please do not use it for malicious activities or spam. Always ensure you have permission before sending emails on behalf of others. βοΈ
This project is licensed under the MIT License - see the LICENSE file for details.