none
Sendmail Office365 API RRS feed

  • Question

  • I have a simple script that sends a message from a shared mailbox in Office365 using the v1.0 REST api. it was working fine until early august. Now I am getting a "400 bad request" response. - has anything changed?

    Below is the script

    {
      "Message": {
        "Subject": "$title",
        "Body": {
          "ContentType": "Text",
          "Content": "TestScript"
        },
        "ToRecipients": [
          {
            "EmailAddress": {
              "Address": "$emailaddress"
            }
          }
        ]
      },
      "SaveToSentItems": "false"
    }
    
    Invoke-WebRequest -Uri $('https://outlook.office365.com/api/v1.0/users/' + $emailaddress + '/sendmail') -Credential $credential -ContentType 'application/json' -Method Post -Body $data

    Tuesday, September 12, 2017 7:05 AM