I guess you want to get the current email in MIME format (aka *.eml file type). If so, see the answer.
1. Exchange Web Services (EWS). Prior 2019 year
You have to use Exchange Web Services (EWS) and there are two ways:
Do it in JavaScript via makeEwsRequestAsync() method by setting IncludeMimeContent property in the request and process content of the MimeContent tag of the response (it's base64, so you may need to decode).
But it doesn't work on iOS/Android (link) and the email size limit for JavaScript APIs is 1 MB (see all limitations of the JavaScript API), so the implementation of fetching and decoding the email must run on the back-end (which may be an unnecessary load for the server). Hence you may forget option #1 and start reading the next option.
Send EWS request and process the response on the back-end. But for that you need to get a callback token (for authentication from your back-end), item ID of the email and the EWS url (see this post on how to get them in the add-in).
Having said that, there are said news. Since July 2018 Microsoft issues only security updates for EWS (see the official statement). They phase it out in favour of Microsoft Graph, the new gateway to Office data, which so far does NOT support export of email in the EML format. The feature is promised in beta by the end of 2018.
2. Microsoft Graph. Starting from 2019 year
EWS is dead and Microsoft Graph is the way to go. The Microsoft folks promised to expose the entire email MIME stream in Outlook Mail REST API (should be in beta by now). So keep an eye on Outlook mail REST API.
Note: MS Graph works only with Exchange Online (Office 365 in the cloud) or on Exchange on-premises in a hybrid deployment (requires at least Exchange 2016 Cumulative Update 3 (CU3) on-premises server integrated with Office 365).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…