title: Send mail with large attachment?
body: <p>I'm looking to use the graph API to send emails with large attachments (up to 20MB). Is there any way of sending emails with large attachments?</p>
  
  <p>Previous attempts with the Graph lead to the discovery of a 4MB upload limit. I had alternatively also looked into uploading a file to OneDrive and attaching it by reference but I believe that runs into the same 4MB limit. </p>
  
  <p>This limit rules out Microsoft Graph.</p>
  
  <p>I have heard that the legacy Outlook REST API is capable of handling large file uploads, however, I can't find any way of getting access to the Outlook REST API today, it looks like it has been deprecated. Additionally, all documentation I read from Microsoft very quickly encourages you onto the new Graph API instead.</p>
  
  <p>Looking at the Azure Portal there seems to be no way of allowing my application to get authenticated to the Outlook API, it's not an option anywhere.</p>
  
  <p>For reference here is the relevant snippet I've been using with the Graph API.</p>
  
  <pre><code>$mailBody = ...
  'attachments' =&gt; [
      [
          '@odata.type' =&gt; '#microsoft.graph.fileAttachment',
          'Name' =&gt; 'file.docx',
          'ContentBytes' =&gt; $localFile
      ]
   ]
       ...
  
  $response = $this-&gt;getGraph()-&gt;createRequest("POST", "/users/{primary-user}/sendMail")
                  -&gt;attachBody($mailBody)
                  -&gt;execute();
  </code></pre>