diff --git a/README.md b/README.md index 6125b90..9d3e907 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A little service to send e-mail. ## Build ```bash -make +make build ``` ## Configuration @@ -25,15 +25,22 @@ outbox_path = "" # directory used to retrieve `.json` e-mail format to ``` ## How to send a mail ? +### JSON file * create a JSON file like: ```json { "sender":"", - "receivers": ["","", ..., ""], + "receivers": ",, ..., ", "subject": "", "content": "" } ``` -* put the JSON file in the `outbox` directory define in the `.ini` file +* put the JSON file in the `outbox` directory defined in the `.ini` file. -**NOTE**: HTML is interpreted for the e-mail content +### HTTP +An http server is embedded inside `mailsrv` and is listening on port **1212**. To send an email you can post a JSON to **/mail**: +``` +curl http://localhost:1212/mail -d '{"sender":"test@test.com","receivers":"test1@test.com,test2@test.com","subject":"test","content":"

test

"}' +``` + +**NOTE**: HTML is interpreted for the e-mail content.