Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morucci/simple-gmail-mail-sender
Send email via the Gmail API
https://github.com/morucci/simple-gmail-mail-sender
api gmail mail-sender pool python simple yaml
Last synced: about 2 months ago
JSON representation
Send email via the Gmail API
- Host: GitHub
- URL: https://github.com/morucci/simple-gmail-mail-sender
- Owner: morucci
- License: mit
- Created: 2020-11-10T13:41:34.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-12T11:37:35.000Z (about 4 years ago)
- Last Synced: 2023-03-14T19:45:37.100Z (almost 2 years ago)
- Topics: api, gmail, mail-sender, pool, python, simple, yaml
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SGMS (Simple GMAIL Mail Sender)
===============================Simple tool to send email via a GMAIL account. It uses the GMAIL API.
The tool is expected to run from a host with a web browser to run the OAuth2 flow.
Setup GMAIL side
----------------At https://developers.google.com/gmail/api/quickstart/python
1. Enable the GMAIL API then:
2. Enter project name: Perso-Mailer
3. Configure your OAuth client: Desktop app
4. Click on API Console linkVia the console link or at https://console.cloud.google.com/apis/credentials
1. Make sure to have selected: Perso-Mailer project
2. Click on OAuth client
3. Download JSON, and save the file to ~/.sgms/credentials.json.Install sgms into your user account
-----------------------------------```
pip install --user -r requirements.txt
python setup.py install --user
```Run the OAuth2 process to retreive the token
--------------------------------------------```
sgms --auth-only
```Create a message in YAML format
-------------------------------Create a file message.yaml with content such as
```YAML
---
to: @mail.com
subject: Hey my Friend
body: I wish you a very good day !
```Or see example/message.yaml as en example.
Send an email
-------------The email to send must be provided as a YAML payload.
```
sgms --from-email [email protected] --yaml-message mail.yaml
```Send emails for a directory
---------------------------Prepare a directory with some messages as YAML files and run:
```
sgms --from-email [email protected] --yaml-directory pool/
```Message files that have been sent are renamed with the prefix *_sent_*
and won't be proceed the next call of the command.