https://github.com/fayyez/emailer-tool
A Python-based email automation tool for sending emails with attachments, CC lists, and logging functionality. This tool is modular and easy to configure for various use cases.
https://github.com/fayyez/emailer-tool
email-sender emailer python python-script
Last synced: 12 months ago
JSON representation
A Python-based email automation tool for sending emails with attachments, CC lists, and logging functionality. This tool is modular and easy to configure for various use cases.
- Host: GitHub
- URL: https://github.com/fayyez/emailer-tool
- Owner: Fayyez
- Created: 2025-03-22T11:10:53.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-03-22T11:23:26.000Z (12 months ago)
- Last Synced: 2025-03-22T12:24:19.020Z (12 months ago)
- Topics: email-sender, emailer, python, python-script
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Email Tool
A Python-based email automation tool for sending emails with attachments, CC lists, and logging functionality. This tool is modular and easy to configure for various use cases.
## Features
- Send emails to multiple recipients.
- Attach files to emails.
- Add CC recipients.
- Log email statuses (success, error, invalid email).
- Modular design for easy maintenance and extension.
## Project Structure
```
Email Tool/
├── emailer.py # Main script to execute the emailer tool
├── modules/
│ ├── email_utils.py # Utility functions for email handling
│ ├── smtp_utils.py # Utility functions for SMTP server setup
├── receipient_list.txt # List of recipient email addresses
├── cc_list.txt # List of CC email addresses
├── subject.txt # Email subject
├── body.txt # Email body
├── log.csv # Log file for email statuses
```
## Prerequisites
- Python 3.6 or higher
- Required Python libraries:
- `smtplib`
- `email`
- `os`
- `re`
- `datetime`
- `time`
## Setup
1. Clone the repository:
```shell
git clone
cd Email Tool
```
2. Configure the following files:
- `receipient_list.txt`: Add recipient email addresses (one per line).
- `cc_list.txt`: Add CC email addresses (one per line).
- `subject.txt`: Add the email subject.
- `body.txt`: Add the email body content.
3. Update the `emailer.py` script:
- Set the `sender` email address and `password` in the global variables section.
- Add file paths for attachments in the `attachment_file_paths` list.
## Usage
1. Run the script:
```shell
python emailer.py
```
2. The script will:
- Validate the sender email address.
- Check for required files (recipients, CC list, subject, body, log).
- Send emails to all valid recipients.
- Log the status of each email in `log.csv`.
## Logging
The `log.csv` file records the status of each email with the following columns:\
- `Recipient`: The recipient's email address.
- `Status`: `success`, `error`, or `invalid`.
- `DateTime`: The timestamp of the email attempt.
- `Error`: The error message (if any).
## Modular Design
The project is divided into modules for better maintainability:
- `email_utils.py`: Contains functions for sending emails and validating email addresses.
- `smtp_utils.py`: Contains functions for setting up the SMTP server.
## Notes
- If using Gmail, ensure you have enabled "App Passwords" for authentication. Refer to [Google's App Passwords Guide](https://myaccount.google.com/apppasswords).
- The script pauses for 5 seconds between sending emails to avoid rate-limiting issues.
## License
This project is licensed under the MIT License. See the `LICENSE` file for details.