This Python script allows you to send emails to multiple recipients listed in a text file. It supports sending emails with or without attachments using the SMTP protocol.
- Send bulk emails to multiple recipients.
- Supports attachments.
- Uses Gmail SMTP for email delivery.
Before running the script, ensure you have:
- A Gmail account.
- Enabled "Less Secure Apps" access or generated an App Password from your Google account settings (Generate App Password).
- Python3 installed on your system.
-
Clone this repository:
git clone [email protected]:PrakshaaleJain/Cold-Mailer.git cd Cold-Mailer
-
Create a virtual enviroment and activate it:
python -m venv venv source venv/bin/activate # on linux or MacOS venv\Scripts\activate # On Windows
-
Install dependencies:
pip install smtplib email os
- Update the email credentials in the script:
email = "[email protected]" password = "your-app-password"
- Add recipient email addresses in
emails.txt
(one per line). - Set the attachment file path:
attachment_path = "path/to/attachment"
- Set the email file path:
with open("path/to/emails.txt", "r") as file: email_list = [l.strip() for l in file if l.strip()]
Run the script using:
python3 send_email.py
- Ensure your
emails.txt
file contains valid email addresses. - If you do not want to send an attachment, comment out the relevant section in the script.
- Double-check the
attachment_path
to ensure the file exists before running the script.
This project is licensed under the MIT License.