microsoftgraph / microsoftgraph/msgraph-sdk-php
Sending email : "403 Forbidden" Only for MIME message
Nessuno ha ancora preso questa issue.
- Lingua principale
- PHP
- Stelle
- 669
- Fork
- 150
- Merge medio
- 15h 21m
- PR unite (30g)
- 3
Descrizione
Hi, I'm using the version 1.110.
I have the following error trying to send an email in MIME type:
Client error: `POST https://graph.microsoft.com/v1.0/users/[EMAIL_ADDRESS]/sendMail` resulted in a `403 Forbidden` response:
{"error":{"code":"ErrorSendAsDenied","message":"The user account which was used to submit this request does not have the right to send mail on behalf of the specified sending account., Cannot submit message."}}
The code used to send is the following:
$requestUrl = '/users/' . $username . '/sendMail';
$emailResponse = $this->graphClient->createRequest('POST', $requestUrl)
->addHeaders(["Content-Type" => "text/plain"])
->attachBody(base64_encode(serialize([
"Content-Type" => "text/plain",
'message' => $mimeContent
])))->execute();
With the same email account, if I send an email in Json format I do not have any error.
Any Idea how to solve?
Thanks
Francesco
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la richiesta PHP in createRequest('POST', '/users/.../sendMail') e confronta il relativo corpo MIME e gli header con la richiesta JSON che ha esito positivo. Verifica i requisiti di Microsoft Graph per i messaggi MIME di sendMail; il lavoro è completo quando si è identificato se la richiesta è malformata o se all'account manca l'autorizzazione, e si è documentata la correzione necessaria.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- php
- Ambito
- api
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100