Skip to content

tjobarow/pymsgraph_mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pymsgraph_mail

A lightweight (requiring only one external dependency - requests to run) python wrapper over the user: sendMail MSGraph API endpoint, allowing you to easily integrate mail functionality into any Python workflow. Supports including file attachments, mail importance, CC recipients, and BCC recipients, among other features.

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.

Requirements

Python Dependencies

To build and import the package you need to install:

requests==2.32.3

or rather

pip install -r requirements.txt

Microsoft Graph API Requirements

  • Enterprise application with OAuth credentials, and permission to use the SendMail Graph API endpoint
  • An existing user account to source the email from

Quick Start

Please check out the example_usage.py file to learn how to use the package! It's fairly simple overall.

Custom Message Header

This package implements a custom header attached to each message (email) it sends to the Microsoft Graph API. This is done for the express purpose of making it easier to identify emails sent via this package in other automated workflows. This was implemented as sending tons of emails with this script might result in your mailbox becoming full. You can then write subsequent automation to remove sent messages with this header.

The header is set as follows::

{"name": "x-SentBySimpleSendMail", "value": "true"}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages