Skip to content

enley-es/django-outlook-email-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django outlook email backend

Outlook api email backend for Django

First steps

Retrieve the client id, client secret and tenant id from the Azure portal. Follow this documentation: https://learn.microsoft.com/en-us/azure/api-management/authentication-authorization-overview Add the Mail.send permision to the app in the Azure portal.

Requirements

  • Python 3.8+
  • Django 5.0, 4.2

Installation

Install using pip...

pip install django-outlook-email-backend

Add 'OUTLOOK_CREDENTIALS' in settings.py

OUTLOOK_CREDENTIALS = {
    'OUTLOOK_CLIENT_ID': "XXXXX",
    'OUTLOOK_CLIENT_SECRET': "XXXXX",
    'OUTLOOK_TENANT_ID': "XXXXX",
}

Add 'EMAIL_BACKEND' in settings.py

EMAIL_BACKEND = "django_outlook_email.django_outlook_email_backend.OutlookEmailBackend"

if you want to use json instead of mime add the following line in settings.py

OUTLOOK_CREDENTIALS["OUTLOOK_SEND_FORMAT"] = "json"