GithubHelp home page GithubHelp logo

django-o365mail's Introduction

Evelien Dekkers

I create awesome PCBs for enthusiast mechanical keyboards and do a lot of programming in Python. Visit my website at evelien.dev!

django-o365mail's People

Contributors

evyd13 avatar lucasmoeskops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

django-o365mail's Issues

Provide valid auth credentials

When i add this at settings.py
EMAIL_BACKEND = 'django_o365mail.EmailBackend'

O365_MAIL_CLIENT_ID = 'REPLACE THIS'
O365_MAIL_CLIENT_SECRET = 'REPLACE THIS'
O365_MAIL_TENANT_ID = 'REPLACE THIS'

and run my app this is giving me this error:
image

No mail sent

I am using this plugin trying to send mail using a client i added all config the token is always getting generated:
image

but try-catch do not handle any error when i try to send mail so its a success right? but i am not accepting any mail on destination what can be issue any1 has any idea???!

Happy coding

How to get the following id secret and tanant

Hi.

Once I installed it package successfully how I get
can the following information from office365 to configure in settings.py?

O365_MAIL_CLIENT_ID = 'REPLACE THIS'
O365_MAIL_CLIENT_SECRET = 'REPLACE THIS'
O365_MAIL_TENANT_ID = 'REPLACE THIS'
You can refer to link to how to generate these information?

400 Client Error: Bad Request Error Message: Resource not found for the segment 'sendMail'.

Hi

I try to setup up the package as your advice as a prior question.
this link #7

400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/sendMail | Error Message: Resource not found for the segment 'sendMail'.

I click to https://graph.microsoft.com/v1.0/sendMail in order to dig deeper into additional error

{"error":{"code":"InvalidAuthenticationToken","message":"Access token is empty.","innerError":{"date":"2022-11-24T13:45:25","request-id":"4b533efc-d806-4829-a506-ba03599ebd69","client-request-id":"4b533efc-d806-4829-a506-ba03599ebd69"}}}

image

Below are my code and configuration and package installation.

image

settings.py

EMAIL_BACKEND = 'django_o365mail.EmailBackend'
O365_MAIL_CLIENT_ID ='xxxxxxxxxxxxxxx'
O365_MAIL_CLIENT_SECRET ='yyyyzzzyyyyy'
O365_MAIL_TENANT_ID ='zzzzzzzzz'
O365_ACTUALLY_SEND_IN_DEBUG=True

views.py

from django.core.mail import BadHeaderError, send_mail
from django.http import HttpResponse
def send_mail_office365(request):
    try:
        send_mail(
            subject='SmartApp - Test Sending Email',
            message='Hi, ok',
            from_email='[email protected]',
            recipient_list=['[email protected]'])
    except BadHeaderError:
        return HttpResponse('Invalid header found.')
    return render(request,
                  'app/pm_doc_gen_pdf.html',
                  {})

The last picture is what the azure administrator of my company set up.
image

Thank you for your advice

Customize Token backend

We run our website on a docker container which gives permission errors when trying to store files on it, which the default FileSystemTokenBackend does. O365 package also supports different token backends, such as EnvTokenBackend which stores the tokens in the environment. It would be nice if the token backend could be customized when using this package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.