Skip to content

MS365GraphMailer is a Python script for sending emails via the Microsoft Graph API. It uses an Azure AD App Registration for authentication and supports various email fields.

License

Notifications You must be signed in to change notification settings

rutgers-master/MS365GraphMailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

MS365GraphMailer

MS365GraphMailer is a Python script designed to send emails using the Microsoft Graph API. It uses an Entra ID (Azure AD) App Registration to authenticate and authorize email sending.

Requirements

On Windows after installing Python:

python pip install requests

On RHEL 8.x Linux:

yum install python36 python3-requests

On Debian/Ubuntu Linux:

apt install python3 python3-requests

Getting Started

Ready to get started? Clone the repo, or just grab the MS365GraphMailer.py program.

Read the instructions at the top of the program which will walk you through setting up the Entra ID (Azure AD) App Registartion. There are only 3 variables in the code that need to be modified:

  • CLIENT_ID: The Application (client) ID from the App Registration.
  • CLIENT_SECRET: The client secret from the App Registration.
  • TENANT_ID: The Directory (tenant) ID from the App Registration.

You can then send a test message with something like:

python MS365GraphMailer.py -f myfrom@address.here -t myto@address.here -s "Test Subject" -m "Test Body"

If you run into any errors, please double check the App Registration setup and the variables in the code.

About

MS365GraphMailer is a Python script for sending emails via the Microsoft Graph API. It uses an Azure AD App Registration for authentication and supports various email fields.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages