motze92 / office365-mail

Office365 transport for Laravel
MIT License
62 stars 21 forks source link

400 Bad Request from Graph #28

Closed beard7 closed 2 years ago

beard7 commented 2 years ago

Hi, I'm getting the following when sending:

Client error: `POST https://graph.microsoft.com/v1.0/users/{email-removed}/sendmail` resulted in a `400 Bad Request` response:
{"error":{"code":"RequestBodyRead","message":"Cannot convert the literal '0' to the expected type 'Edm.String'."}}

I'm trying to switch from https://github.com/wapacro/laravel-msgraph-mail which doesn't support Laravel 9, but otherwise works (so Office 365 is configured correctly).

Any advice is greatly appreciated.

beard7 commented 2 years ago

Apologies, looks like I was possibly using the wrong CLIENT_SECRET

bart-heideman commented 2 years ago

Hi Beard7, I've got the same error. Did you solve it by just changing the client secret? Many thanks in advance.

beard7 commented 2 years ago

Kind of, but not really. It fixed that particular error, but now I'm getting a different one #31

bart-heideman commented 2 years ago

Thanks for your prompt reply and good luck with solving this! If I find anything useful I'll let you know.

bart-heideman commented 2 years ago

For people having the same problem. I narrowed it down to the bcc function.

I usually bcc emails to the sending address as a copy. By disabling bcc I can send through the graph API;)

I am using laravel 9 on php 8.0.7 and this package version 3.

beard7 commented 2 years ago

Good to know, but unfortunately I rely heavily on the BCC function. I believe #31 may be something to do with PHP 8.1.