From our web application running in company network, I'm looking for an alternative way of "mailto" approach (since "mailto" supports plain text only for the body section and has no attachment support) for opening up a new message (email) popup in Outlook (company uses Outlook). I'm trying to implement this by JavaScript.
After some search, I think I have 2 options available:
- Handling mail sending operation via our web application by opening a send mail popup, including attachment and nice looking html body template,
- Trying to integrate our web application with an Outlook office add-in
This web application is for purchasing department and Outlook usage of them is high.
If option 1 has been chosen, I think there will be a need to present previous mail recipient suggestions and sent mail history page.
I'm not exactly sure that option 2 can be implemented, or provided by Outlook.
Any suggestions will be highly appreciated. Many thanks in advance.
CodePudding user response:
IMHO the only reliable way to show a new message in Outlook from a browser other than IE is to dynamically create an EML (MIME) file with HTML body and attachments populated. Just make sure to add "X-Unsent: 1"
MIME header to show the message as draft and avoid populating From
/Sender
headers.
CodePudding user response:
None of the options described are valid. And I will explain why:
The web application can use Graph API if you deal with O365 or EWS if you have Exchange on-premise profiles. In that case you could compose and send emails programmatically from your web application. But you need to handle all requests for the message history and etc. in the code. That's a lot of work I suppose! But if you don't need to show a list of messages like Outlook does, just to submit emails you could Graph API on the server to send emails.
Web add-ins are run under the context of currently selected mail/calendar items in Outlook. So, they don't have anything to help there.