2

Trying to send an email through Microsoft Graph where another email from user mailbox is to be used as an attachment.

What I am doing is something similar to:

POST https://graph.microsoft.com/v1.0/me/sendMail HTTP/1.1
authorization: bearer {access_token}
content-type: application/json
content-length: 96

{
    "message": {
        "subject": "Meet for lunch?",
        "body": {
            "contentType": "Text",
            "content": "The new cafeteria is open."
        },
        "toRecipients": [{
            "emailAddress": {
                "address": "garthf@a830edad9050849NDA1.onmicrosoft.com"
            }
        }],
        "attachments": [
            "@odata.type": "#Microsoft.OutlookServices.ItemAttachment",
            "name": "menu.txt",
            "item": {
                "id": "some_id"
                <!--This is the id of an existing email in User's inbox -->
            }
        ]
    },
    "saveToSentItems": "false"
}

This returns with

Cannot process input of abstract type Microsoft.OutlookServices.Item

Can anyone help with suggestions?

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
Kuiznoe
  • 21
  • 2
  • Duplicate of https://stackoverflow.com/questions/46528376/send-new-message-that-includes-a-different-message-from-users-inbox-as-attachme – Jason Johnston Oct 26 '17 at 14:03
  • Possible duplicate of [Send new message that includes a different message from user's inbox as attachment](https://stackoverflow.com/questions/46528376/send-new-message-that-includes-a-different-message-from-users-inbox-as-attachme) – Marc LaFleur Oct 26 '17 at 17:44

0 Answers0