# mailsrv A little service to send e-mail. ## Build ```bash make build ``` ## Configuration `mailsrv` uses an SMTP server to send e-mail so, you need to provide some informations to send e-mails through it: ```ini [server] url = "" port = "" # 25 or 587 username = "" password = "" [service] outbox_path = "" # directory used to retrieve `.json` e-mail format to send ``` ## Run ```bash ./mailsrv myconfig.ini ``` ## How to send a mail ? ### JSON file * create a JSON file like: ```json { "sender":"", "receivers": ",, ..., ", "subject": "", "content": "" } ``` * put the JSON file in the `outbox` directory defined in the `.ini` file. ### 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.