29 lines
586 B
Markdown
29 lines
586 B
Markdown
|
# restful mailer
|
||
|
|
||
|
a simple and hacky rest api for sending emails
|
||
|
|
||
|
# running (bare metal)
|
||
|
|
||
|
```sh
|
||
|
pip install -r requirements.txt
|
||
|
python -m flask run --host=0.0.0.0
|
||
|
```
|
||
|
|
||
|
# running (docker)
|
||
|
|
||
|
```sh
|
||
|
docker build . -t resting-mailer
|
||
|
docker run -p 5000:5000 resting-mailer
|
||
|
```
|
||
|
|
||
|
# sending emails
|
||
|
|
||
|
assuming run on localhost
|
||
|
|
||
|
``` sh
|
||
|
curl --header "Content-Type: application/json" \
|
||
|
http://localhost:5000/send \
|
||
|
-d \
|
||
|
'{"host": "<host>", "username": "<username>", "password": "<password", "to": "<someone>", "from": "<me>", "subject": "testicle", "content": "balls to the wall"}'
|
||
|
```
|