Skip to content

Latest commit

 

History

History
68 lines (56 loc) · 2.38 KB

README.md

File metadata and controls

68 lines (56 loc) · 2.38 KB

Sending Email using FastAPI Mail

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.

Description

FastAPI-Mail is a simple lightweight mail system, sending emails and attachments(individual && bulk). This project shows how to send emails both asynchronously and using Background Tasks. The email body parameters are provided as the request body. These parameters are then used by the HTML email template
The image below shows the request body(Right side) and the email received by the recepient (Left side)


Table of contents

Prerequisites

Directory-Structure

FastAPI-Mail
├── app			             # contains app files 
|   ├── models.py  
|	└── send_mail.py  
├── templates
|   ├── email
|   |   └── email.html 
|	└── landing_page.html 
├── .env    
├── main.py                  # Application entry point
├── requirements.txt		 # project dependencies
└── README.md

Setting-up-Local-Environment

clone the repository and navigate to the project directory

git clone https://github.com/maxwellwachira/FastAPI-Mail.git
cd FastAPI-Mail/

Create a python virtual environment and activate it

python3 -m venv venv
source venv/bin/activate

Install Project dependencies

pip install -r requirements.txt

create a file and name it as .env. Copy contents of .env.example to .env

Acknowledgement

Special thanks to sabuhish the author of fastapi-mail module.
Special thanks to Sebastián Ramírez aka @tiangolo the creator of FastAPI

License

license