This is a simple mailer that reads data from Google Sheets and can send emails using Python.
Python 3.9+ is required to run this project. You can download it from:
Clone the repository and navigate to the project directory in the terminal.
git clone https://github.com/ConducereIT/send-mailer/
cd send-mailerCreate a virtual environment and install the dependencies:
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
pip install -r requirements.txtTo use the mailer, you need to configure the following environment variables in a .env file:
GOOGLE_SHEET_ID=your_google_sheet_id # must have a column named "email"
SEND_MAIL_HOST=smtp.gmail.com
SEND_MAIL_USER=your_email@gmail.com
SEND_MAIL_PASS=your_app_password
SEND_MAIL_SERVICE=Gmail
SEND_MAIL_SUBJECT=your_email_subject # the subject of the email
TEMPLATE_PATH=path/to/your/index.html # the path to the template html file
REPLACE_ARRAY_NAMES=name,phone,etc # the name of the columns in the sheet that will be replaced in the templateTo run the application:
python app.pyThe application will:
- Read data from the specified Google Sheet
- Check for duplicate email addresses
- Display all found email addresses and names
- Log all operations to
app.log - Send emails to the found email addresses with the specified subject and template
- Reads data from Google Sheets
- Validates email addresses
- Checks for duplicate emails
- Detailed logging
- Configurable through environment variables
- Sends emails to the found email addresses with the specified subject and template
This project is licensed under the MIT License - see the LICENSE file for details