- stmp_server The SMTP server to use (e.g.
smtp.gmail.com) - smtp_port The SMTP port (Optional; Defaults to SMTP SSL port 465)
- email_from The email address and username on the server (e.g.
support@example.org) - email_pwd The corresponding password
- email_to The email address of the recipient. (Optional; By default this is the same as the sender)
To use a Gmail account for sending the emails, enable "Allow less secure apps" here.
- Install requirements with
pip3 install -r requirements.txt - Add .env file to root of project directory
- Run app with
uvicorn --env-file ./.env --app-dir ./app/ main:app - Explore API at http://127.0.0.1:8000
The application can be run inside a docker container with
docker build -t contactform .
docker run -d --env-file ./.env --name contactform -p 80:80 contactform