Outlook Rest API sending mail with attachments
<p>I've written an application that automates the sending of mail from our system via a small console app that i've designed to run in azure as a webjob. The app sends mail perfectly fine until I attempt to add a collection of attatchments. Referring to <a href="https://msdn.microsoft.com/office/office365/APi/mail-rest-operations#Createandsendmessages" rel="nofollow">https://msdn.microsoft.com/office/office365/APi/mail-rest-operations#Createandsendmessages</a> 
I've attempted to send their sample code for this with my Attatchments collection containing a single object that looks like this</p>

<p><code>{
    "@odata.type": "#Microsoft.OutlookServices.FileAttachment",
    "Name": "menu.txt",
    "ContentBytes": "bWFjIGFuZCBjaGVlc2UgdG9kYXk="
}</code></p>

<p>However, after this api request was rejected with the error: </p>

<pre><code>{"error":{"code":"RequestBodyRead","message":"The property 'ContentBytes' does not exist on type 'Microsoft.OutlookServices.Attachment'. Make sure to only use property names that are defined by the type."}}
</code></pre>

<p>And furthermore spending half an hour on the outlook services support line to fobbed off with go checkout some forums and to read the article I'd been using for reference since I started the project I've thrown in the towel. If anyone can assist me in getting this api to accept the request I'd be eternally thankful. </p>

<p>This is what a sample request looks like. </p>

<pre><code>POST https://outlook.office.com/api/v2.0/me/sendmail
    {
      "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.FileAttachment",
            "Name": "menu.txt",
            "ContentBytes": "bWFjIGFuZCBjaGVlc2UgdG9kYXk="
          }
        ]
      },
      "SaveToSentItems": "false"
    }
</code></pre>

<p>And I'm aware that the message object has a bool flag of HasAttachments which when set to true does not affect the outcome of the call.</p>