Open technqvi opened 1 year ago
The error message is related to the Office 365 and not to this package. I assume somewhere your permissions or authentication is not correct. Check the graphql documentation from Microsoft on this specific error
Also dont forget to set the mailbox! O365_MAIL_MAILBOX_KWARGS = {'resource': 'o365mailbox@domain.com'}
I got it done. One thing I missed is to add O365_MAIL_MAILBOX_KWARGS = {'resource': 'aaaaa@xxxxxgroup.com'} on settings.py
Thank you for supporting me.
Ok
I think the need to add the O365_MAIL_MAILBOX_KWARGS should be added to the documentation as it is not obvious that this is required to someone using the package for the first time. I had to also add to the Django app settings.py the e-mail for the DEFAULT_FROM_EMAIL and the SERVER_MAIL setting using the format DEFAULT_FROM_EMAIL='your email here'. Without this I was getting an error that the user account which submitted the request didn't have the right to send the email on behalf of the specified sending account. The e-mail in these two settings is the same e-mail I specified in the O365_MAIL_MAILBOX_KWARGS.
Hi
I try to setup up the package as your advice as a prior question. this link https://github.com/evyd13/django-o365mail/issues/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"}}}
Below are my code and configuration and package installation.
settings.py
views.py
The last picture is what the azure administrator of my company set up.
Thank you for your advice