diff --git a/README.md b/README.md index 798367e..2798bd1 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ Leisure project. A REST API that sends a one-time authentication code (a.k.a OTP Setup: - Create a new `.env` file - Add your `EMAIL_SENDER` and `EMAIL_PASSWORD` in your `.env` file +- Optional: + - By default I use gmail for email host, you can configure your `HOST` in the `.env` file. + - You can also add `PORT` in `.env` - Create or use an API test app like Postman Usage: diff --git a/main.py b/main.py index 87ec116..00e810f 100644 --- a/main.py +++ b/main.py @@ -74,7 +74,7 @@ def send_email(): # Everyone has a different email host service # By default we use gmail to test our emails mail_host = os.environ.get("HOST") if os.environ.get("HOST") is not None else "smtp.gmail.com" - mail_port = 465 + mail_port = os.environ.get("PORT") if os.environ.get("PORT") is not None else 465 if mail_sender is None or mail_password is None: return jsonify({