A lightweight (requiring only one external dependency - requests
to run) python wrapper over the user: sendMail API endpoint, allowing you to easily integrate mail functionality into any Python workflow. Supports including file attachments, CC recipients, and BCC recipients.
Note: While the wrapper does only require requests
to run, you do need to have build
and wheel
installed to build the package from source.
To build and import the package you need to install:
build==1.2.2.post1
wheel==0.45.1
requests==2.32.3
or rather
pip install -r requirements.txt
- Enterprise application with OAuth credentials, and permission to use the SendMail Graph API endpoint
- An existing user account to source the email from
-
To build SimpleO365SendMail from source, first clone the repo to a local directory.
-
Create a new python virtual environment (if you have Python's
venv
module installed)
python -m venv .my-venv
- Activate the environment (depends on OS)
- Linux/MacOS:
source ./.my-venv/bin/activate
- Windows (PowerShell|CMD prompt)
./.my-venv/Scripts/[Activate.ps1|Activate.bat]
- Install buildtools & wheel
pip install build wheel
- Build package from within cloned repo
python -m build --wheel
- Install SimpleO365SendMail using pip from within root directory of SimpleO365SendMail
pip install .
Please check out the example_usage.py file to learn how to use the package! It's fairly simple overall.