Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zavierferodova/python-mail-sender
Python Email Sender with Excel Spreadsheet Data
https://github.com/zavierferodova/python-mail-sender
email-sender smtp smtp-client ssl
Last synced: 4 days ago
JSON representation
Python Email Sender with Excel Spreadsheet Data
- Host: GitHub
- URL: https://github.com/zavierferodova/python-mail-sender
- Owner: zavierferodova
- Created: 2024-07-31T08:13:24.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-31T09:33:00.000Z (4 months ago)
- Last Synced: 2024-07-31T10:34:30.100Z (4 months ago)
- Topics: email-sender, smtp, smtp-client, ssl
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python Mail Sender
A script to help you send bulk of email message using Excel Spreadsheet data.### Setup
1. Install required depedencies,
```sh
pip -r requirements.txt
```
2. Copy `.env.example` to `.env` file,
```sh
cp .env.example .env
```
3. Configure env file,
```
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=465
SENDER_EMAIL=
SENDER_PASSWORD=```
### Usage
First of all you need to prepare spreadsheet data like example below,
| Name | Recipient | Attachment1 | Attachment2 |
|:-----------:|:-------------------:|:-----------------:|:-----------------:|
| John Doe | [email protected] | path/to/file.pdf | path/to/file.jpg |
| John Carlos | [email protected] | path/to/file2.pdf | path/to/file2.jpg |- **Important !** \
Make sure your data has `recipient` column to specify message destination.
- **Attachments** \
Create columns with prefix `attachment` using format like `attachment1`, `attachment_2`, `attachment_3`, etc. Then fill that column with file attachment destination path.
- **Running Script** \
Here is the command example that you can use to run the script,
```sh
python app.py --data Data.xlsx
```### Templating
You can modify subject and body of message on `template/subject.txt` and `template/body.txt` with custom content.
And you can using columns as variable to replace message content, all columns converted to lowercase variable format you can use that like below,
- **Input:**
```
Hello {{name}} this is email subject
```
- **Output:**
```
Hello John Doe this is email subject
```### Logging
This script log the process on `app.log` file, you can observe it using command below when you're run this script.
```
tail -f app.log
```### Credits
Made by Zavier Ferodova Al Fitroh 😎 \
Enjoyyy...