This app enables you to send email from a form.
This project assumes you have a SMTP relay server with no authentication required, so that means your relay must accept this app ip address(host) to be added as a valid sender.
This also assumes you have a valid captcha v2 key from google, paired with the sender.
Access to this app via POST request with json object as body, with the following variables:
- reason. If this is not present, it will assume you have only one route for mail.
- name
- message
- subject
- g-recaptcha-response
- Clone this repository.
- Modify the
smtp_config.txtfile with your SMTP configuration and details. Note that the 5th line defines all the routes for mail. If you want to add more routes, add them in the same format as the example. - Build and run the Docker container using the following command:
docker-compose up --build - The contact API will be available at
http://localhost:3001/contact. This is accesible via POST request, check variables that must be send as urlencoded-form-data.