microsoftgraph / microsoftgraph/msgraph-sdk-php

Sending email : "403 Forbidden" Only for MIME message

オープン
#1,499 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
PHP
スター
669
フォーク
150
平均マージ
15時間 21分
マージ済み PR(30日)
3

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

createRequest('POST', '/users/.../sendMail') の PHP リクエストから始め、MIME ボディとヘッダーを成功する JSON リクエストと比較します。MIME メッセージに対する Microsoft Graph の sendMail 要件を確認します。リクエストの形式が不正なのか、アカウントに権限がないのかを特定し、必要な修正を文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
api
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。